From 5aac0b7354d19b62f820216b4c15018628add1f3 Mon Sep 17 00:00:00 2001 From: Sandro Mani Date: Mar 24 2022 15:22:08 +0000 Subject: Update to 2.38 --- diff --git a/.gitignore b/.gitignore index 859b46f..be1631d 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ binutils-2.20.1.tar.bz2 /binutils-2.34.tar.bz2 /binutils-2.36.1.tar.bz2 /binutils-2.37.tar.xz +/binutils-2.38.tar.xz diff --git a/CVE-2021-45078.patch b/CVE-2021-45078.patch deleted file mode 100644 index f8ecc0e..0000000 --- a/CVE-2021-45078.patch +++ /dev/null @@ -1,231 +0,0 @@ -diff -rupN --no-dereference binutils-2.37/binutils/stabs.c binutils-2.37-new/binutils/stabs.c ---- binutils-2.37/binutils/stabs.c 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/binutils/stabs.c 2021-12-18 01:10:13.228719862 +0100 -@@ -202,7 +202,7 @@ static debug_type stab_find_type (void * - static bool stab_record_type - (void *, struct stab_handle *, const int *, debug_type); - static debug_type stab_xcoff_builtin_type -- (void *, struct stab_handle *, int); -+ (void *, struct stab_handle *, unsigned int); - static debug_type stab_find_tagged_type - (void *, struct stab_handle *, const char *, int, enum debug_type_kind); - static debug_type *stab_demangle_argtypes -@@ -3496,166 +3496,167 @@ stab_record_type (void *dhandle ATTRIBUT - - static debug_type - stab_xcoff_builtin_type (void *dhandle, struct stab_handle *info, -- int typenum) -+ unsigned int typenum) - { - debug_type rettype; - const char *name; - -- if (typenum >= 0 || typenum < -XCOFF_TYPE_COUNT) -+ typenum = -typenum - 1; -+ if (typenum >= XCOFF_TYPE_COUNT) - { -- fprintf (stderr, _("Unrecognized XCOFF type %d\n"), typenum); -+ fprintf (stderr, _("Unrecognized XCOFF type %d\n"), -typenum - 1); - return DEBUG_TYPE_NULL; - } -- if (info->xcoff_types[-typenum] != NULL) -- return info->xcoff_types[-typenum]; -+ if (info->xcoff_types[typenum] != NULL) -+ return info->xcoff_types[typenum]; - -- switch (-typenum) -+ switch (typenum) - { -- case 1: -+ case 0: - /* The size of this and all the other types are fixed, defined - by the debugging format. */ - name = "int"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 2: -+ case 1: - name = "char"; - rettype = debug_make_int_type (dhandle, 1, false); - break; -- case 3: -+ case 2: - name = "short"; - rettype = debug_make_int_type (dhandle, 2, false); - break; -- case 4: -+ case 3: - name = "long"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 5: -+ case 4: - name = "unsigned char"; - rettype = debug_make_int_type (dhandle, 1, true); - break; -- case 6: -+ case 5: - name = "signed char"; - rettype = debug_make_int_type (dhandle, 1, false); - break; -- case 7: -+ case 6: - name = "unsigned short"; - rettype = debug_make_int_type (dhandle, 2, true); - break; -- case 8: -+ case 7: - name = "unsigned int"; - rettype = debug_make_int_type (dhandle, 4, true); - break; -- case 9: -+ case 8: - name = "unsigned"; - rettype = debug_make_int_type (dhandle, 4, true); - break; -- case 10: -+ case 9: - name = "unsigned long"; - rettype = debug_make_int_type (dhandle, 4, true); - break; -- case 11: -+ case 10: - name = "void"; - rettype = debug_make_void_type (dhandle); - break; -- case 12: -+ case 11: - /* IEEE single precision (32 bit). */ - name = "float"; - rettype = debug_make_float_type (dhandle, 4); - break; -- case 13: -+ case 12: - /* IEEE double precision (64 bit). */ - name = "double"; - rettype = debug_make_float_type (dhandle, 8); - break; -- case 14: -+ case 13: - /* This is an IEEE double on the RS/6000, and different machines - with different sizes for "long double" should use different - negative type numbers. See stabs.texinfo. */ - name = "long double"; - rettype = debug_make_float_type (dhandle, 8); - break; -- case 15: -+ case 14: - name = "integer"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 16: -+ case 15: - name = "boolean"; - rettype = debug_make_bool_type (dhandle, 4); - break; -- case 17: -+ case 16: - name = "short real"; - rettype = debug_make_float_type (dhandle, 4); - break; -- case 18: -+ case 17: - name = "real"; - rettype = debug_make_float_type (dhandle, 8); - break; -- case 19: -+ case 18: - /* FIXME */ - name = "stringptr"; - rettype = NULL; - break; -- case 20: -+ case 19: - /* FIXME */ - name = "character"; - rettype = debug_make_int_type (dhandle, 1, true); - break; -- case 21: -+ case 20: - name = "logical*1"; - rettype = debug_make_bool_type (dhandle, 1); - break; -- case 22: -+ case 21: - name = "logical*2"; - rettype = debug_make_bool_type (dhandle, 2); - break; -- case 23: -+ case 22: - name = "logical*4"; - rettype = debug_make_bool_type (dhandle, 4); - break; -- case 24: -+ case 23: - name = "logical"; - rettype = debug_make_bool_type (dhandle, 4); - break; -- case 25: -+ case 24: - /* Complex type consisting of two IEEE single precision values. */ - name = "complex"; - rettype = debug_make_complex_type (dhandle, 8); - break; -- case 26: -+ case 25: - /* Complex type consisting of two IEEE double precision values. */ - name = "double complex"; - rettype = debug_make_complex_type (dhandle, 16); - break; -- case 27: -+ case 26: - name = "integer*1"; - rettype = debug_make_int_type (dhandle, 1, false); - break; -- case 28: -+ case 27: - name = "integer*2"; - rettype = debug_make_int_type (dhandle, 2, false); - break; -- case 29: -+ case 28: - name = "integer*4"; - rettype = debug_make_int_type (dhandle, 4, false); - break; -- case 30: -+ case 29: - /* FIXME */ - name = "wchar"; - rettype = debug_make_int_type (dhandle, 2, false); - break; -- case 31: -+ case 30: - name = "long long"; - rettype = debug_make_int_type (dhandle, 8, false); - break; -- case 32: -+ case 31: - name = "unsigned long long"; - rettype = debug_make_int_type (dhandle, 8, true); - break; -- case 33: -+ case 32: - name = "logical*8"; - rettype = debug_make_bool_type (dhandle, 8); - break; -- case 34: -+ case 33: - name = "integer*8"; - rettype = debug_make_int_type (dhandle, 8, false); - break; -@@ -3664,9 +3665,7 @@ stab_xcoff_builtin_type (void *dhandle, - } - - rettype = debug_name_type (dhandle, name, rettype); -- -- info->xcoff_types[-typenum] = rettype; -- -+ info->xcoff_types[typenum] = rettype; - return rettype; - } - diff --git a/binutils-2.27-aarch64-ifunc.patch b/binutils-2.27-aarch64-ifunc.patch deleted file mode 100644 index 17eb80d..0000000 --- a/binutils-2.27-aarch64-ifunc.patch +++ /dev/null @@ -1,11 +0,0 @@ -diff -rupN --no-dereference binutils-2.37/bfd/elfnn-aarch64.c binutils-2.37-new/bfd/elfnn-aarch64.c ---- binutils-2.37/bfd/elfnn-aarch64.c 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/elfnn-aarch64.c 2021-07-24 21:59:12.398868364 +0200 -@@ -5473,6 +5473,7 @@ elfNN_aarch64_final_link_relocate (reloc - it here if it is defined in a non-shared object. */ - if (h != NULL - && h->type == STT_GNU_IFUNC -+ && (input_section->flags & SEC_ALLOC) - && h->def_regular) - { - asection *plt; diff --git a/binutils-CVE-2019-1010204.patch b/binutils-CVE-2019-1010204.patch index e3a7c80..56434b1 100644 --- a/binutils-CVE-2019-1010204.patch +++ b/binutils-CVE-2019-1010204.patch @@ -1,7 +1,6 @@ -diff -rupN --no-dereference binutils-2.37/gold/fileread.cc binutils-2.37-new/gold/fileread.cc ---- binutils-2.37/gold/fileread.cc 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/gold/fileread.cc 2021-07-24 21:59:22.937765719 +0200 -@@ -385,6 +385,12 @@ File_read::do_read(off_t start, section_ +--- binutils.orig/gold/fileread.cc 2019-08-06 14:22:08.669313110 +0100 ++++ binutils-2.32/gold/fileread.cc 2019-08-06 14:22:28.799177543 +0100 +@@ -381,6 +381,12 @@ File_read::do_read(off_t start, section_ ssize_t bytes; if (this->whole_file_view_ != NULL) { diff --git a/binutils-autoconf-version.patch b/binutils-autoconf-version.patch new file mode 100644 index 0000000..f94fdad --- /dev/null +++ b/binutils-autoconf-version.patch @@ -0,0 +1,11 @@ +--- binutils.orig/config/override.m4 2021-08-31 14:20:17.275574804 +0100 ++++ binutils-2.37/config/override.m4 2021-08-31 14:36:37.793954247 +0100 +@@ -41,7 +41,7 @@ dnl Or for updating the whole tree at on + AC_DEFUN([_GCC_AUTOCONF_VERSION_CHECK], + [m4_if(m4_defn([_GCC_AUTOCONF_VERSION]), + m4_defn([m4_PACKAGE_VERSION]), [], +- [m4_fatal([Please use exactly Autoconf ]_GCC_AUTOCONF_VERSION[ instead of ]m4_defn([m4_PACKAGE_VERSION])[.])]) ++ []) + ]) + m4_define([AC_INIT], m4_defn([AC_INIT])[ + _GCC_AUTOCONF_VERSION_CHECK diff --git a/binutils-do-not-link-with-static-libstdc++.patch b/binutils-do-not-link-with-static-libstdc++.patch index 354992a..49d46c2 100644 --- a/binutils-do-not-link-with-static-libstdc++.patch +++ b/binutils-do-not-link-with-static-libstdc++.patch @@ -1,7 +1,7 @@ -diff -rupN --no-dereference binutils-2.37/configure binutils-2.37-new/configure ---- binutils-2.37/configure 2021-07-18 18:36:27.000000000 +0200 -+++ binutils-2.37-new/configure 2021-07-24 21:59:14.582847093 +0200 -@@ -5257,49 +5257,6 @@ if test -z "$LD"; then +diff -rup binutils.orig/configure binutils-2.30/configure +--- binutils.orig/configure 2018-09-24 17:50:06.967172922 +0100 ++++ binutils-2.30/configure 2018-09-24 17:51:16.648624865 +0100 +@@ -4996,49 +4996,6 @@ if test -z "$LD"; then fi fi @@ -51,10 +51,10 @@ diff -rupN --no-dereference binutils-2.37/configure binutils-2.37-new/configure if test -n "$ac_tool_prefix"; then -diff -rupN --no-dereference binutils-2.37/configure.ac binutils-2.37-new/configure.ac ---- binutils-2.37/configure.ac 2021-07-18 18:48:58.000000000 +0200 -+++ binutils-2.37-new/configure.ac 2021-07-24 21:59:14.583847083 +0200 -@@ -1300,26 +1300,6 @@ if test -z "$LD"; then +diff -rup binutils.orig/configure.ac binutils-2.30/configure.ac +--- binutils.orig/configure.ac 2018-09-24 17:50:07.241170767 +0100 ++++ binutils-2.30/configure.ac 2018-09-24 17:50:29.908992486 +0100 +@@ -1288,26 +1288,6 @@ if test -z "$LD"; then fi fi diff --git a/binutils-do-not-use-debuginfod.patch b/binutils-do-not-use-debuginfod.patch new file mode 100644 index 0000000..be1f43a --- /dev/null +++ b/binutils-do-not-use-debuginfod.patch @@ -0,0 +1,258 @@ +diff -rup binutils.orig/binutils/NEWS binutils-2.38/binutils/NEWS +--- binutils.orig/binutils/NEWS 2022-03-10 09:13:18.284641005 +0000 ++++ binutils-2.38/binutils/NEWS 2022-03-10 09:13:26.007586352 +0000 +@@ -1,5 +1,8 @@ + -*- text -*- + ++* Add an option to objdump and readelf to prevent attempts to access debuginfod ++ servers when following links. ++ + Changes in 2.38: + + * elfedit: Add --output-abiversion option to update ABIVERSION. +diff -rup binutils.orig/binutils/doc/binutils.texi binutils-2.38/binutils/doc/binutils.texi +--- binutils.orig/binutils/doc/binutils.texi 2022-03-10 09:13:18.285640998 +0000 ++++ binutils-2.38/binutils/doc/binutils.texi 2022-03-10 09:13:26.009586338 +0000 +@@ -2246,6 +2246,8 @@ objdump [@option{-a}|@option{--archive-h + @option{--dwarf}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]] + [@option{-WK}|@option{--dwarf=follow-links}] + [@option{-WN}|@option{--dwarf=no-follow-links}] ++ [@option{-wD}|@option{--dwarf=use-debuginfod}] ++ [@option{-wE}|@option{--dwarf=do-not-use-debuginfod}] + [@option{-L}|@option{--process-links}] + [@option{--ctf=}@var{section}] + [@option{-G}|@option{--stabs}] +@@ -4879,6 +4881,8 @@ readelf [@option{-a}|@option{--all}] + @option{--debug-dump}[=rawline,=decodedline,=info,=abbrev,=pubnames,=aranges,=macro,=frames,=frames-interp,=str,=str-offsets,=loc,=Ranges,=pubtypes,=trace_info,=trace_abbrev,=trace_aranges,=gdb_index,=addr,=cu_index,=links]] + [@option{-wK}|@option{--debug-dump=follow-links}] + [@option{-wN}|@option{--debug-dump=no-follow-links}] ++ [@option{-wD}|@option{--debug-dump=use-debuginfod}] ++ [@option{-wE}|@option{--debug-dump=do-not-use-debuginfod}] + [@option{-P}|@option{--process-links}] + [@option{--dwarf-depth=@var{n}}] + [@option{--dwarf-start=@var{n}}] +@@ -5504,7 +5508,8 @@ deduced from the input file + @cindex separate debug files + + debuginfod is a web service that indexes ELF/DWARF debugging resources +-by build-id and serves them over HTTP. ++by build-id and serves them over HTTP. For more information see: ++@emph{https://sourceware.org/elfutils/Debuginfod.html} + + Binutils can be built with the debuginfod client library + @code{libdebuginfod} using the @option{--with-debuginfod} configure option. +@@ -5516,6 +5521,10 @@ separate debug files when the files are + debuginfod is packaged with elfutils, starting with version 0.178. + You can get the latest version from `https://sourceware.org/elfutils/'. + ++The DWARF info dumping tools (@command{readelf} and @command{objdump}) ++have options to control when they should access the debuginfod ++servers. By default this access is enabled. ++ + @node Reporting Bugs + @chapter Reporting Bugs + @cindex bugs +Only in binutils-2.38/binutils/doc: binutils.texi.orig +diff -rup binutils.orig/binutils/doc/debug.options.texi binutils-2.38/binutils/doc/debug.options.texi +--- binutils.orig/binutils/doc/debug.options.texi 2022-03-10 09:13:18.285640998 +0000 ++++ binutils-2.38/binutils/doc/debug.options.texi 2022-03-10 09:13:26.009586338 +0000 +@@ -68,10 +68,27 @@ chosen when configuring the binutils via + @option{--enable-follow-debug-links=no} options. If these are not + used then the default is to enable the following of debug links. + ++Note - if support for the debuginfod protocol was enabled when the ++binutils were built then this option will also include an attempt to ++contact any debuginfod servers mentioned in the @var{DEBUGINFOD_URLS} ++environment variable. This could take some time to resolve. This ++behaviour can be disabled via the @option{=do-not-use-debuginfod} debug ++option. ++ + @item N + @itemx =no-follow-links + Disables the following of links to separate debug info files. + ++@item D ++@itemx =use-debuginfod ++Enables contacting debuginfod servers if there is a need to follow ++debug links. This is the default behaviour. ++ ++@item E ++@itemx =do-not-use-debuginfod ++Disables contacting debuginfod servers when there is a need to follow ++debug links. ++ + @item l + @itemx =rawline + Displays the contents of the @samp{.debug_line} section in a raw +diff -rup binutils.orig/binutils/dwarf.c binutils-2.38/binutils/dwarf.c +--- binutils.orig/binutils/dwarf.c 2022-03-10 09:13:18.283641012 +0000 ++++ binutils-2.38/binutils/dwarf.c 2022-03-10 09:13:26.010586331 +0000 +@@ -109,6 +109,9 @@ int do_debug_cu_index; + int do_wide; + int do_debug_links; + int do_follow_links = DEFAULT_FOR_FOLLOW_LINKS; ++#ifdef HAVE_LIBDEBUGINFOD ++int use_debuginfod = 1; ++#endif + bool do_checks; + + int dwarf_cutoff_level = -1; +@@ -11038,7 +11041,7 @@ debuginfod_fetch_separate_debug_info (st + + return false; + } +-#endif ++#endif /* HAVE_LIBDEBUGINFOD */ + + static void * + load_separate_debug_info (const char * main_filename, +@@ -11157,9 +11160,10 @@ load_separate_debug_info (const char * + { + char * tmp_filename; + +- if (debuginfod_fetch_separate_debug_info (xlink, +- & tmp_filename, +- file)) ++ if (use_debuginfod ++ && debuginfod_fetch_separate_debug_info (xlink, ++ & tmp_filename, ++ file)) + { + /* File successfully downloaded from server, replace + debug_filename with the file's path. */ +@@ -11207,13 +11211,15 @@ load_separate_debug_info (const char * + warn (_("tried: %s\n"), debug_filename); + + #if HAVE_LIBDEBUGINFOD +- { +- char *urls = getenv (DEBUGINFOD_URLS_ENV_VAR); +- if (urls == NULL) +- urls = ""; ++ if (use_debuginfod) ++ { ++ char *urls = getenv (DEBUGINFOD_URLS_ENV_VAR); + +- warn (_("tried: DEBUGINFOD_URLS=%s\n"), urls); +- } ++ if (urls == NULL) ++ urls = ""; ++ ++ warn (_("tried: DEBUGINFOD_URLS=%s\n"), urls); ++ } + #endif + } + +@@ -11707,6 +11713,9 @@ dwarf_select_sections_by_names (const ch + { "aranges", & do_debug_aranges, 1 }, + { "cu_index", & do_debug_cu_index, 1 }, + { "decodedline", & do_debug_lines, FLAG_DEBUG_LINES_DECODED }, ++#ifdef HAVE_LIBDEBUGINFOD ++ { "do-not-use-debuginfod", & use_debuginfod, 0 }, ++#endif + { "follow-links", & do_follow_links, 1 }, + { "frames", & do_debug_frames, 1 }, + { "frames-interp", & do_debug_frames_interp, 1 }, +@@ -11730,6 +11739,9 @@ dwarf_select_sections_by_names (const ch + { "trace_abbrev", & do_trace_abbrevs, 1 }, + { "trace_aranges", & do_trace_aranges, 1 }, + { "trace_info", & do_trace_info, 1 }, ++#ifdef HAVE_LIBDEBUGINFOD ++ { "use-debuginfod", & use_debuginfod, 1 }, ++#endif + { NULL, NULL, 0 } + }; + +@@ -11783,6 +11795,10 @@ dwarf_select_sections_by_letters (const + case 'A': do_debug_addr = 1; break; + case 'a': do_debug_abbrevs = 1; break; + case 'c': do_debug_cu_index = 1; break; ++#ifdef HAVE_LIBDEBUGINFOD ++ case 'D': use_debuginfod = 1; break; ++ case 'E': use_debuginfod = 0; break; ++#endif + case 'F': do_debug_frames_interp = 1; /* Fall through. */ + case 'f': do_debug_frames = 1; break; + case 'g': do_gdb_index = 1; break; +diff -rup binutils.orig/binutils/dwarf.h binutils-2.38/binutils/dwarf.h +--- binutils.orig/binutils/dwarf.h 2022-03-10 09:13:18.284641005 +0000 ++++ binutils-2.38/binutils/dwarf.h 2022-03-10 09:13:26.010586331 +0000 +@@ -224,6 +224,9 @@ extern int do_debug_cu_index; + extern int do_wide; + extern int do_debug_links; + extern int do_follow_links; ++#ifdef HAVE_LIBDEBUGINFOD ++extern int use_debuginfod; ++#endif + extern bool do_checks; + + extern int dwarf_cutoff_level; +diff -rup binutils.orig/binutils/objdump.c binutils-2.38/binutils/objdump.c +--- binutils.orig/binutils/objdump.c 2022-03-10 09:13:18.283641012 +0000 ++++ binutils-2.38/binutils/objdump.c 2022-03-10 09:13:26.011586324 +0000 +@@ -281,6 +281,14 @@ usage (FILE *stream, int status) + Do not follow links to separate debug info files\n\ + (default)\n")); + #endif ++#if HAVE_LIBDEBUGINFOD ++ fprintf (stream, _("\ ++ -WD --dwarf=use-debuginfod\n\ ++ When following links, also query debuginfod servers (default)\n")); ++ fprintf (stream, _("\ ++ -WE --dwarf=do-not-use-debuginfod\n\ ++ When following links, do not query debuginfod servers\n")); ++#endif + fprintf (stream, _("\ + -L, --process-links Display the contents of non-debug sections in\n\ + separate debuginfo files. (Implies -WK)\n")); +Only in binutils-2.38/binutils/: objdump.c.orig +diff -rup binutils.orig/binutils/readelf.c binutils-2.38/binutils/readelf.c +--- binutils.orig/binutils/readelf.c 2022-03-10 09:13:18.302640878 +0000 ++++ binutils-2.38/binutils/readelf.c 2022-03-10 09:13:26.012586316 +0000 +@@ -5126,6 +5126,14 @@ usage (FILE * stream) + Do not follow links to separate debug info files\n\ + (default)\n")); + #endif ++#if HAVE_LIBDEBUGINFOD ++ fprintf (stream, _("\ ++ -wD --debug-dump=use-debuginfod\n\ ++ When following links, also query debuginfod servers (default)\n")); ++ fprintf (stream, _("\ ++ -wE --debug-dump=do-not-use-debuginfod\n\ ++ When following links, do not query debuginfod servers\n")); ++#endif + fprintf (stream, _("\ + --dwarf-depth=N Do not display DIEs at depth N or greater\n")); + fprintf (stream, _("\ +Only in binutils-2.38/binutils/: readelf.c.orig +diff -rup binutils.orig/binutils/testsuite/binutils-all/debuginfod.exp binutils-2.38/binutils/testsuite/binutils-all/debuginfod.exp +--- binutils.orig/binutils/testsuite/binutils-all/debuginfod.exp 2022-03-10 09:13:18.291640956 +0000 ++++ binutils-2.38/binutils/testsuite/binutils-all/debuginfod.exp 2022-03-10 09:13:26.012586316 +0000 +@@ -185,8 +185,14 @@ proc test_fetch_debugaltlink { prog prog + } + + if { [regexp ".*DEBUGINFOD.*" $conf_objdump] } { +- test_fetch_debuglink $OBJDUMP "-W" ++ test_fetch_debuglink $OBJDUMP "-W -WD" + test_fetch_debugaltlink $OBJDUMP "-Wk" ++ ++ set test "disabling debuginfod access" ++ setup_xfail *-*-* ++ test_fetch_debuglink $OBJDUMP "-W -WE" ++ set test "debuginfod" ++ + } else { + untested "$test (objdump not configured with debuginfod)" + } +@@ -194,6 +200,12 @@ if { [regexp ".*DEBUGINFOD.*" $conf_objd + if { [regexp ".*DEBUGINFOD.*" $conf_readelf] } { + test_fetch_debuglink $READELF "-w" + test_fetch_debugaltlink $READELF "-wk" ++ ++ set test "disabling debuginfod access" ++ setup_xfail *-*-* ++ test_fetch_debuglink $READELF "-w -wE" ++ set test "debuginfod" ++ + } else { + untested "$test (readelf not configured with debuginfod)" + } diff --git a/binutils-export-demangle.h.patch b/binutils-export-demangle.h.patch index ee635cb..9716a8b 100644 --- a/binutils-export-demangle.h.patch +++ b/binutils-export-demangle.h.patch @@ -1,6 +1,6 @@ -diff -rupN --no-dereference binutils-2.37/bfd/Makefile.am binutils-2.37-new/bfd/Makefile.am ---- binutils-2.37/bfd/Makefile.am 2021-07-24 21:59:01.980969825 +0200 -+++ binutils-2.37-new/bfd/Makefile.am 2021-07-24 21:59:01.986969767 +0200 +diff -rup binutils.orig/bfd/Makefile.am binutils-2.32/bfd/Makefile.am +--- binutils.orig/bfd/Makefile.am 2019-02-08 12:22:51.395684251 +0000 ++++ binutils-2.32/bfd/Makefile.am 2019-02-08 12:22:53.970664973 +0000 @@ -33,7 +33,7 @@ bfdlibdir = @bfdlibdir@ bfdincludedir = @bfdincludedir@ bfdlib_LTLIBRARIES = libbfd.la @@ -10,9 +10,9 @@ diff -rupN --no-dereference binutils-2.37/bfd/Makefile.am binutils-2.37-new/bfd/ else !INSTALL_LIBBFD # Empty these so that the respective installation directories will not be created. bfdlibdir = -diff -rupN --no-dereference binutils-2.37/bfd/Makefile.in binutils-2.37-new/bfd/Makefile.in ---- binutils-2.37/bfd/Makefile.in 2021-07-24 21:59:01.980969825 +0200 -+++ binutils-2.37-new/bfd/Makefile.in 2021-07-24 21:59:01.987969757 +0200 +diff -rup binutils.orig/bfd/Makefile.in binutils-2.32/bfd/Makefile.in +--- binutils.orig/bfd/Makefile.in 2019-02-08 12:21:35.291254044 +0000 ++++ binutils-2.32/bfd/Makefile.in 2019-02-08 12:22:10.163992947 +0000 @@ -249,7 +249,7 @@ am__can_run_installinfo = \ esac am__bfdinclude_HEADERS_DIST = $(INCDIR)/plugin-api.h bfd.h \ @@ -22,7 +22,7 @@ diff -rupN --no-dereference binutils-2.37/bfd/Makefile.in binutils-2.37-new/bfd/ HEADERS = $(bfdinclude_HEADERS) RECURSIVE_CLEAN_TARGETS = mostlyclean-recursive clean-recursive \ distclean-recursive maintainer-clean-recursive -@@ -469,7 +469,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel +@@ -468,7 +468,7 @@ libbfd_la_LDFLAGS = $(am__append_1) -rel @INSTALL_LIBBFD_FALSE@bfdinclude_HEADERS = $(am__append_2) @INSTALL_LIBBFD_TRUE@bfdinclude_HEADERS = $(BFD_H) \ @INSTALL_LIBBFD_TRUE@ $(INCDIR)/ansidecl.h $(INCDIR)/symcat.h \ diff --git a/binutils-filename-in-error-messages.patch b/binutils-filename-in-error-messages.patch index a06480b..e23d3ec 100644 --- a/binutils-filename-in-error-messages.patch +++ b/binutils-filename-in-error-messages.patch @@ -1,6 +1,5 @@ -diff -rupN --no-dereference binutils-2.37/binutils/readelf.c binutils-2.37-new/binutils/readelf.c ---- binutils-2.37/binutils/readelf.c 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/binutils/readelf.c 2021-07-24 21:59:05.781932809 +0200 +--- binutils.orig/binutils/readelf.c 2021-07-19 12:39:14.206556025 +0100 ++++ binutils-2.37/binutils/readelf.c 2021-07-19 12:44:37.712728732 +0100 @@ -21873,45 +21873,52 @@ process_file (char * file_name) struct stat statbuf; char armag[SARMAG]; @@ -122,3 +121,14 @@ diff -rupN --no-dereference binutils-2.37/binutils/readelf.c binutils-2.37-new/b free (ba_cache.strtab); ba_cache.strtab = NULL; +--- binutils.orig/binutils/readelf.c 2021-08-10 10:15:22.088016072 +0100 ++++ binutils-2.37/binutils/readelf.c 2021-08-10 10:15:55.567907891 +0100 +@@ -21884,7 +21884,7 @@ process_file (char * file_name) + Filedata * filedata = NULL; + struct stat statbuf; + char armag[SARMAG]; +- bool ret = true; ++ bool ret = false; + char * name; + char * saved_program_name; + diff --git a/binutils-fix-testsuite-failures.patch b/binutils-fix-testsuite-failures.patch index af32305..c2b19a5 100644 --- a/binutils-fix-testsuite-failures.patch +++ b/binutils-fix-testsuite-failures.patch @@ -1,58 +1,25 @@ -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elfvers/vers24.rd binutils-2.37-new/ld/testsuite/ld-elfvers/vers24.rd ---- binutils-2.37/ld/testsuite/ld-elfvers/vers24.rd 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-elfvers/vers24.rd 2021-07-24 21:59:18.647807502 +0200 -@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e - # And ensure the dynamic symbol table contains at least x@VERS.0 - # and foo@@VERS.0 symbols - #... -- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 -+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* - #... -- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 -+ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* - #... - Symbol table '.symtab' contains [0-9]+ entries: - #pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-10.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-10.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-10.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-10.d 2021-07-24 21:59:18.648807492 +0200 -@@ -32,7 +32,8 @@ hook called: claim_file tmpdir/func.o \[ - hook called: claim_file tmpdir/libtext.a \[@.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF -+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY -+#... - hook called: cleanup. - #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-11.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-11.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-11.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-11.d 2021-07-24 21:59:18.648807492 +0200 -@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[ - hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED - #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 13:40:26.911199033 +0000 +@@ -34,5 +34,6 @@ hook called: claim_file tmpdir/libtext.a hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF -+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY --Sym: '_?text' Resolution: LDPR_PREVAILING_DEF -+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-13.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-13.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-13.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-13.d 2021-07-24 21:59:18.648807492 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-13.d 2019-02-15 13:41:30.189692800 +0000 @@ -23,5 +23,3 @@ hook called: claim_file tmpdir/main.o \[ hook called: claim_file .*/ld/testsuite/ld-plugin/func.c \[@0/.* CLAIMED hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... -.*main.c.*: undefined reference to `\.?func' -#... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-14.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-14.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-14.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-14.d 2021-07-24 21:59:18.649807482 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-14.d 2019-02-15 13:42:03.598430960 +0000 @@ -27,7 +27,6 @@ hook called: claim_file .*/ld/testsuite/ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... @@ -62,9 +29,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-14.d bin +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-15.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-15.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-15.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-15.d 2021-07-24 21:59:18.649807482 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-15.d 2019-02-15 13:42:28.014239600 +0000 @@ -28,7 +28,6 @@ hook called: claim_file .*/ld/testsuite/ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... @@ -74,9 +41,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-15.d bin +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-16.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-16.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-16.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-16.d 2021-07-24 21:59:18.649807482 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-16.d 2019-02-15 13:43:21.309821910 +0000 @@ -30,9 +30,8 @@ hook called: claim_file .*/ld/testsuite/ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... @@ -89,9 +56,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-16.d bin +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-17.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-17.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-17.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-17.d 2021-07-24 21:59:18.649807482 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-17.d 2019-02-15 13:43:54.925558451 +0000 @@ -31,7 +31,8 @@ hook called: claim_file .*/ld/testsuite/ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... @@ -102,37 +69,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-17.d bin +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-18.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-18.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-18.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-18.d 2021-07-24 21:59:18.650807473 +0200 -@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/ - hook called: claim_file tmpdir/libtext.a \[@.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF -+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY -+#... - hook called: cleanup. - #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-19.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-19.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-19.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-19.d 2021-07-24 21:59:18.650807473 +0200 -@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/ - hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF -+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY --Sym: '_?text' Resolution: LDPR_PREVAILING_DEF -+Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY -+#... - hook called: cleanup. - #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-20.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-20.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-20.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-20.d 2021-07-24 21:59:18.650807473 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-20.d 2019-02-15 13:49:20.091010016 +0000 @@ -2,6 +2,5 @@ hook called: all symbols read. Input: func.c \(tmpdir/libfunc.a\) Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* @@ -141,9 +80,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-20.d bin -.*main.c.*: undefined reference to `\.?func' +#... hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-21.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-21.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-21.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-21.d 2021-07-24 21:59:18.650807473 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-21.d 2019-02-15 13:49:34.506897033 +0000 @@ -2,6 +2,5 @@ hook called: all symbols read. Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\) Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* @@ -152,9 +91,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-21.d bin -.*main.c.*: undefined reference to `\.?func' +#... hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-22.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-22.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-22.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-22.d 2021-07-24 21:59:18.650807473 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-22.d 2019-02-15 13:50:00.409694022 +0000 @@ -2,6 +2,5 @@ Claimed: tmpdir/libfunc.a \[@.* hook called: all symbols read. Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* @@ -163,9 +102,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-22.d bin -.*main.c.*: undefined reference to `\.?func' +#... hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-23.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-23.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-23.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-23.d 2021-07-24 21:59:18.651807463 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-23.d 2019-02-15 13:50:14.938580156 +0000 @@ -2,6 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func. hook called: all symbols read. Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* @@ -174,47 +113,48 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-23.d bin -.*main.c.*: undefined reference to `\.?func' +#... hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-24.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-24.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-24.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-24.d 2021-07-24 21:59:18.651807463 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-24.d 2019-02-15 13:49:46.346804240 +0000 @@ -2,4 +2,5 @@ hook called: all symbols read. Input: .*/ld/testsuite/ld-plugin/func.c \(.*/ld/testsuite/ld-plugin/func.c\) Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +#... hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-25.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-25.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-25.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-25.d 2021-07-24 21:59:18.651807463 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-25.d 2019-02-15 13:50:29.322467422 +0000 @@ -2,4 +2,5 @@ Claimed: .*/ld/testsuite/ld-plugin/func. hook called: all symbols read. Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* Sym: '_?func' Resolution: LDPR_PREVAILING_DEF.* +#... hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-28.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-28.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-28.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-28.d 2021-07-24 21:59:18.651807463 +0200 -@@ -1 +1,2 @@ +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 13:45:05.343006557 +0000 +@@ -1 +1,3 @@ .*: error: Error +#... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-29.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-29.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-29.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-29.d 2021-07-24 21:59:18.652807453 +0200 ++ +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:33:21.978627293 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-29.d 2019-02-15 13:45:22.764870016 +0000 @@ -1 +1,2 @@ .*: warning: Warning +#... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-30.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-30.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-30.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-30.d 2021-07-24 21:59:18.652807453 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:33:21.976627309 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-30.d 2019-02-15 13:48:57.067190464 +0000 @@ -24,3 +24,4 @@ hook called: claim_file tmpdir/main.o \[ hook called: claim_file tmpdir/func.o \[@0/.* not claimed hook called: claim_file tmpdir/text.o \[@0/.* not claimed hook called: claim_file tmpdir/libempty.a \[@.* not claimed +#pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-6.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-6.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-6.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-6.d 2021-07-24 21:59:18.652807453 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:33:21.979627285 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-6.d 2019-02-15 13:37:14.672749977 +0000 @@ -27,7 +27,6 @@ hook called: claim_file tmpdir/func.o \[ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... @@ -224,9 +164,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-6.d binu +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-7.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-7.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-7.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-7.d 2021-07-24 21:59:18.652807453 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-7.d 2019-02-15 13:37:58.000400421 +0000 @@ -28,7 +28,6 @@ hook called: claim_file tmpdir/func.o \[ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... @@ -236,24 +176,21 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-7.d binu +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-8.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-8.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-8.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-8.d 2021-07-24 21:59:18.653807444 +0200 -@@ -30,9 +30,8 @@ hook called: claim_file tmpdir/func.o \[ - hook called: claim_file tmpdir/text.o \[@0/.* not claimed - #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:33:21.980627277 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 13:38:34.096109209 +0000 +@@ -32,7 +32,6 @@ hook called: claim_file tmpdir/text.o \[ hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF -+Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func' Resolution: LDPR_PREVAILING_DEF Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY -.*: tmpdir/main.o: in function `main': -.*main.c.*: undefined reference to `\.?func' +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-9.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-9.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-9.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-9.d 2021-07-24 21:59:18.653807444 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:33:21.977627301 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-9.d 2019-02-15 13:39:52.655475403 +0000 @@ -31,7 +31,8 @@ hook called: claim_file tmpdir/func.o \[ hook called: claim_file tmpdir/text.o \[@0/.* not claimed #... @@ -264,25 +201,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-9.d binu +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin.exp binutils-2.37-new/ld/testsuite/ld-plugin/plugin.exp ---- binutils-2.37/ld/testsuite/ld-plugin/plugin.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin.exp 2021-07-24 21:59:18.653807444 +0200 -@@ -117,6 +117,12 @@ if { $can_compile && !$failed_compile } - } - } - -+# I do not know why, but the underscore prefix test is going -+# wrong on ppc64le targets. So override it here. -+if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } { -+ set _ "" -+} -+ - set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o" - set testobjfiles_notext "tmpdir/main.o tmpdir/func.o" - set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o" -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/pr20070.d binutils-2.37-new/ld/testsuite/ld-plugin/pr20070.d ---- binutils-2.37/ld/testsuite/ld-plugin/pr20070.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/pr20070.d 2021-07-24 21:59:18.653807444 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d binutils-2.32/ld/testsuite/ld-plugin/pr20070.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:33:21.976627309 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/pr20070.d 2019-02-15 13:50:56.874251486 +0000 @@ -5,5 +5,6 @@ Sym: 'weakdef' Resolution: LDPR_PREVAILI Sym: 'undef' Resolution: LDPR_UNDEF Sym: 'weakundef' Resolution: LDPR_UNDEF @@ -290,9 +211,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/pr20070.d binut +#... hook called: cleanup. #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-srec/srec.exp binutils-2.37-new/ld/testsuite/ld-srec/srec.exp ---- binutils-2.37/ld/testsuite/ld-srec/srec.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-srec/srec.exp 2021-07-24 21:59:18.654807434 +0200 +diff -rup binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp binutils-2.32/ld/testsuite/ld-srec/srec.exp +--- binutils-2.32.orig/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:33:21.938627615 +0000 ++++ binutils-2.32/ld/testsuite/ld-srec/srec.exp 2019-02-15 13:53:58.744814006 +0000 @@ -21,6 +21,8 @@ # Get the offset from an S-record line to the start of the data. @@ -302,3 +223,108 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-srec/srec.exp binutils proc srec_off { l } { if [string match "S1*" $l] { return 8 +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:10:59.038709514 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-10.d 2019-02-15 14:13:53.532300721 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:10:59.041709490 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-11.d 2019-02-15 14:14:50.061844322 +0000 +@@ -35,8 +35,9 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:10:58.942710289 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-18.d 2019-02-15 14:15:20.030602369 +0000 +@@ -32,7 +32,8 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:10:59.024709627 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-19.d 2019-02-15 14:15:54.926320633 +0000 +@@ -35,8 +35,9 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++#... + hook called: cleanup. + #... +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:10:58.998709837 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-28.d 2019-02-15 14:12:19.856057024 +0000 +@@ -1,3 +1,2 @@ + .*: error: Error + #... +- +diff -rup binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d +--- binutils-2.32.orig/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:10:59.074709224 +0000 ++++ binutils-2.32/ld/testsuite/ld-plugin/plugin-8.d 2019-02-15 14:11:48.144313048 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF ++Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-elfvers/vers24.rd binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd +--- binutils.orig/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 09:45:44.013108697 +0100 ++++ binutils-2.30/ld/testsuite/ld-elfvers/vers24.rd 2018-09-05 12:06:17.287425232 +0100 +@@ -7,9 +7,9 @@ Symbol table '.dynsym' contains [0-9]+ e + # And ensure the dynamic symbol table contains at least x@VERS.0 + # and foo@@VERS.0 symbols + #... +- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 ++ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* + #... +- +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0 ++ +[0-9]+: [0-9a-f]+ +(4 +OBJECT +GLOBAL +DEFAULT +[0-9]+ _?x|[0-9]+ +FUNC +GLOBAL +DEFAULT .* [0-9]+ _?foo@)@VERS\.0.* + #... + Symbol table '.symtab' contains [0-9]+ entries: + #pass +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin.exp binutils-2.30/ld/testsuite/ld-plugin/plugin.exp +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 09:45:44.023108605 +0100 ++++ binutils-2.30/ld/testsuite/ld-plugin/plugin.exp 2018-09-05 11:18:53.997202105 +0100 +@@ -118,6 +118,12 @@ if { $can_compile && !$failed_compile } + } + } + ++# I do not know why, but the underscore prefix test is going ++# wrong on ppc64le targets. So override it here. ++if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } { ++ set _ "" ++} ++ + set testobjfiles "tmpdir/main.o tmpdir/func.o tmpdir/text.o" + set testobjfiles_notext "tmpdir/main.o tmpdir/func.o" + set testsrcfiles "tmpdir/main.o $srcdir/$subdir/func.c tmpdir/text.o" diff --git a/binutils-gas-loc-view.patch b/binutils-gas-loc-view.patch new file mode 100644 index 0000000..f174caa --- /dev/null +++ b/binutils-gas-loc-view.patch @@ -0,0 +1,91 @@ +diff -rup binutils.orig/gas/symbols.c binutils-2.38/gas/symbols.c +--- binutils.orig/gas/symbols.c 2022-03-09 11:43:34.706610216 +0000 ++++ binutils-2.38/gas/symbols.c 2022-03-09 11:45:57.540686508 +0000 +@@ -61,8 +61,10 @@ struct symbol_flags + /* Whether the symbol can be re-defined. */ + unsigned int volatil : 1; + +- /* Whether the symbol is a forward reference. */ ++ /* Whether the symbol is a forward reference, and whether such has ++ been determined. */ + unsigned int forward_ref : 1; ++ unsigned int forward_resolved : 1; + + /* This is set if the symbol is defined in an MRI common section. + We handle such sections as single common symbols, so symbols +@@ -202,7 +204,7 @@ static void * + symbol_entry_find (htab_t table, const char *name) + { + hashval_t hash = htab_hash_string (name); +- symbol_entry_t needle = { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, ++ symbol_entry_t needle = { { { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }, + hash, name, 0, 0, 0 } }; + return htab_find_with_hash (table, &needle, hash); + } +@@ -784,7 +786,9 @@ symbol_clone (symbolS *orgsymP, int repl + symbolS * + symbol_clone_if_forward_ref (symbolS *symbolP, int is_forward) + { +- if (symbolP && !symbolP->flags.local_symbol) ++ if (symbolP ++ && !symbolP->flags.local_symbol ++ && !symbolP->flags.forward_resolved) + { + symbolS *orig_add_symbol = symbolP->x->value.X_add_symbol; + symbolS *orig_op_symbol = symbolP->x->value.X_op_symbol; +@@ -837,6 +841,7 @@ symbol_clone_if_forward_ref (symbolS *sy + + symbolP->x->value.X_add_symbol = add_symbol; + symbolP->x->value.X_op_symbol = op_symbol; ++ symbolP->flags.forward_resolved = 1; + } + + return symbolP; +diff -rup binutils.orig/gas/testsuite/gas/elf/dwarf2-18.d binutils-2.38/gas/testsuite/gas/elf/dwarf2-18.d +--- binutils.orig/gas/testsuite/gas/elf/dwarf2-18.d 2022-03-09 11:43:34.487611632 +0000 ++++ binutils-2.38/gas/testsuite/gas/elf/dwarf2-18.d 2022-03-09 11:48:03.298873228 +0000 +@@ -2,9 +2,8 @@ + #readelf: -x.rodata -wL + #name: DWARF2 18 + # The am33 cr16 crx ft32 mn10 msp430 nds32 and rl78 targets do not evaluate the subtraction of symbols at assembly time. +-# The mep targets turns some view computations into complex relocations. + # The riscv targets do not support the subtraction of symbols. +-#xfail: am3*-* cr16-* crx-* ft32*-* mep-* mn10*-* msp430-* nds32*-* riscv*-* rl78-* ++#xfail: am3*-* cr16-* crx-* ft32*-* mn10*-* msp430-* nds32*-* riscv*-* rl78-* + + Hex dump of section '\.rodata': + 0x00000000 0100 *.* +--- binutils.orig/gas/dwarf2dbg.c 2022-03-10 09:13:18.516639363 +0000 ++++ binutils-2.38/gas/dwarf2dbg.c 2022-03-10 12:45:25.191933733 +0000 +@@ -402,18 +402,27 @@ set_or_check_view (struct line_entry *e, + if (viewx.X_op != O_constant || viewx.X_add_number) + { + expressionS incv; ++ expressionS *p_view; + + if (!p->loc.u.view) +- { +- p->loc.u.view = symbol_temp_make (); +- gas_assert (!S_IS_DEFINED (p->loc.u.view)); +- } ++ p->loc.u.view = symbol_temp_make (); + + memset (&incv, 0, sizeof (incv)); + incv.X_unsigned = 1; + incv.X_op = O_symbol; + incv.X_add_symbol = p->loc.u.view; + incv.X_add_number = 1; ++ p_view = symbol_get_value_expression (p->loc.u.view); ++ if (p_view->X_op == O_constant || p_view->X_op == O_symbol) ++ { ++ /* If we can, constant fold increments so that a chain of ++ expressions v + 1 + 1 ... + 1 is not created. ++ resolve_expression isn't ideal for this purpose. The ++ base v might not be resolvable until later. */ ++ incv.X_op = p_view->X_op; ++ incv.X_add_symbol = p_view->X_add_symbol; ++ incv.X_add_number = p_view->X_add_number + 1; ++ } + + if (viewx.X_op == O_constant) + { diff --git a/binutils-gcc-10-fixes.patch b/binutils-gcc-10-fixes.patch deleted file mode 100644 index 4233279..0000000 --- a/binutils-gcc-10-fixes.patch +++ /dev/null @@ -1,180 +0,0 @@ -diff -rup binutils.orig/gold/gdb-index.cc binutils-2.34.0/gold/gdb-index.cc ---- binutils.orig/gold/gdb-index.cc 2020-07-24 09:12:29.241306445 +0100 -+++ binutils-2.34.0/gold/gdb-index.cc 2020-07-24 09:15:48.332095898 +0100 -@@ -817,7 +817,7 @@ Gdb_index_info_reader::get_qualified_nam - void - Gdb_index_info_reader::record_cu_ranges(Dwarf_die* die) - { -- unsigned int shndx; -+ unsigned int shndx = 0; - unsigned int shndx2; - - off_t ranges_offset = die->ref_attribute(elfcpp::DW_AT_ranges, &shndx); -diff -rup binutils.orig/gold/layout.cc binutils-2.34.0/gold/layout.cc ---- binutils.orig/gold/layout.cc 2020-07-24 09:12:29.243306433 +0100 -+++ binutils-2.34.0/gold/layout.cc 2020-07-24 09:15:11.464320064 +0100 -@@ -1986,7 +1986,7 @@ Layout::attach_allocated_section_to_segm - seg_flags |= os->extra_segment_flags(); - - // Check for --section-start. -- uint64_t addr; -+ uint64_t addr = 0; - bool is_address_set = parameters->options().section_start(os->name(), &addr); - - // In general the only thing we really care about for PT_LOAD -diff -rup binutils.orig/binutils/dlltool.c binutils-2.34.0/binutils/dlltool.c ---- binutils.orig/binutils/dlltool.c 2020-07-24 09:12:28.974308069 +0100 -+++ binutils-2.34.0/binutils/dlltool.c 2020-07-24 12:09:37.527121295 +0100 -@@ -1305,7 +1305,7 @@ run (const char *what, char *args) - int pid, wait_status; - int i; - const char **argv; -- char *errmsg_fmt, *errmsg_arg; -+ char *errmsg_fmt = "", *errmsg_arg = ""; - char *temp_base = choose_temp_base (); - - inform (_("run: %s %s"), what, args); -diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c ---- binutils.orig/gas/config/tc-arm.c 2020-07-24 09:12:32.368287432 +0100 -+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:14:19.842360634 +0100 -@@ -28416,9 +28416,12 @@ md_apply_fix (fixS * fixP, - perform relaxation. */ - if (value == -2) - { -- newval = md_chars_to_number (buf, THUMB_SIZE); -- newval = 0xbf00; /* NOP encoding T1 */ -- md_number_to_chars (buf, newval, THUMB_SIZE); -+ if (fixP->fx_done || !seg->use_rela_p) -+ { -+ newval = md_chars_to_number (buf, THUMB_SIZE); -+ newval = 0xbf00; /* NOP encoding T1 */ -+ md_number_to_chars (buf, newval, THUMB_SIZE); -+ } - } - else - { -@@ -28631,17 +28634,14 @@ md_apply_fix (fixS * fixP, - case BFD_RELOC_ARM_GOTFUNCDESC: - case BFD_RELOC_ARM_GOTOFFFUNCDESC: - case BFD_RELOC_ARM_FUNCDESC: -- if (arm_fdpic) -- { -- if (fixP->fx_done || !seg->use_rela_p) -- md_number_to_chars (buf, 0, 4); -- } -- else -+ if (!arm_fdpic) - { - as_bad_where (fixP->fx_file, fixP->fx_line, - _("Relocation supported only in FDPIC mode")); -- } -- break; -+ break; -+ } -+ value = 0; -+ /* Fall through. */ - #endif - - case BFD_RELOC_RVA: -diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c ---- binutils.orig/gas/config/tc-arm.c 2020-07-24 12:16:02.099719884 +0100 -+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 12:34:17.690858328 +0100 -@@ -28641,7 +28641,7 @@ md_apply_fix (fixS * fixP, - break; - } - value = 0; -- /* Fall through. */ -+ goto fred; - #endif - - case BFD_RELOC_RVA: -@@ -28653,6 +28653,7 @@ md_apply_fix (fixS * fixP, - #ifdef TE_PE - case BFD_RELOC_32_SECREL: - #endif -+ fred: - if (fixP->fx_done || !seg->use_rela_p) - #ifdef TE_WINCE - /* For WinCE we only do this for pcrel fixups. */ -diff -rup binutils.orig/gas/config/tc-arm.c binutils-2.34.0/gas/config/tc-arm.c ---- binutils.orig/gas/config/tc-arm.c 2020-07-24 13:28:26.926553452 +0100 -+++ binutils-2.34.0/gas/config/tc-arm.c 2020-07-24 13:31:57.835215763 +0100 -@@ -28416,12 +28416,8 @@ md_apply_fix (fixS * fixP, - perform relaxation. */ - if (value == -2) - { -- if (fixP->fx_done || !seg->use_rela_p) -- { -- newval = md_chars_to_number (buf, THUMB_SIZE); -- newval = 0xbf00; /* NOP encoding T1 */ -- md_number_to_chars (buf, newval, THUMB_SIZE); -- } -+ newval = 0xbf00; /* NOP encoding T1 */ -+ goto jim; - } - else - { -@@ -28432,6 +28428,7 @@ md_apply_fix (fixS * fixP, - { - newval = md_chars_to_number (buf, THUMB_SIZE); - newval |= ((value & 0x3e) << 2) | ((value & 0x40) << 3); -+ jim: - md_number_to_chars (buf, newval, THUMB_SIZE); - } - } -diff -rup binutils.orig/binutils/mclex.c binutils-2.34.0/binutils/mclex.c ---- binutils.orig/binutils/mclex.c 2020-07-24 13:28:26.297557441 +0100 -+++ binutils-2.34.0/binutils/mclex.c 2020-07-24 14:46:53.587940149 +0100 -@@ -207,7 +207,7 @@ enum_severity (int e) - static void - mc_add_keyword_ascii (const char *sz, int rid, const char *grp, rc_uint_type nv, const char *sv) - { -- unichar *usz, *usv = NULL; -+ unichar *usz = NULL, *usv = NULL; - rc_uint_type usz_len; - - unicode_from_codepage (&usz_len, &usz, sz, CP_ACP); -diff -rup binutils.orig/binutils/windmc.c binutils-2.34.0/binutils/windmc.c ---- binutils.orig/binutils/windmc.c 2020-07-24 13:28:26.279557556 +0100 -+++ binutils-2.34.0/binutils/windmc.c 2020-07-24 14:48:05.460477478 +0100 -@@ -338,7 +338,7 @@ mc_add_node_lang (mc_node *root, const m - static char * - convert_unicode_to_ACP (const unichar *usz) - { -- char *s; -+ char *s = NULL; - rc_uint_type l; - - if (! usz) -@@ -607,10 +607,10 @@ mc_generate_bin_item (mc_node_lang *n, r - else - { - rc_uint_type txt_len, l; -- char *cvt_txt; -+ char *cvt_txt = NULL; - - codepage_from_unicode( &l, n->message, &cvt_txt, n->lang->lang_info.wincp); -- if (! cvt_txt) -+ if (cvt_txt == NULL) - fatal ("Failed to convert message to language codepage.\n"); - txt_len = strlen (cvt_txt); - if (mcset_automatic_null_termination && txt_len > 0) -@@ -1107,7 +1107,7 @@ main (int argc, char **argv) - - /* Load the input file and do code page transformations to UTF16. */ - { -- unichar *u; -+ unichar *u = NULL; - rc_uint_type ul; - char *buff; - bfd_size_type flen; ---- binutils.orig/binutils/srconv.c 2020-07-24 15:37:25.847459208 +0100 -+++ binutils-2.34.0/binutils/srconv.c 2020-07-24 15:39:12.853773423 +0100 -@@ -316,6 +316,7 @@ wr_hd (struct coff_ofile *p) - struct IT_hd hd; - - hd.spare1 = 0; -+ hd.spare2 = 0; - if (bfd_get_file_flags (abfd) & EXEC_P) - hd.mt = MTYPE_ABS_LM; - else diff --git a/binutils-gold-i386-gnu-property-notes.patch b/binutils-gold-i386-gnu-property-notes.patch index 88955b4..7831bf7 100644 --- a/binutils-gold-i386-gnu-property-notes.patch +++ b/binutils-gold-i386-gnu-property-notes.patch @@ -1,7 +1,8 @@ -diff -rupN --no-dereference binutils-2.37/gold/i386.cc binutils-2.37-new/gold/i386.cc ---- binutils-2.37/gold/i386.cc 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/gold/i386.cc 2021-07-24 21:59:31.051686692 +0200 -@@ -360,7 +360,11 @@ class Target_i386 : public Sized_target< +diff --git a/gold/i386.cc b/gold/i386.cc +index bf209fe9a86..31161ff091c 100644 +--- a/gold/i386.cc ++++ b/gold/i386.cc +@@ -360,7 +360,11 @@ class Target_i386 : public Sized_target<32, false> got_(NULL), plt_(NULL), got_plt_(NULL), got_irelative_(NULL), got_tlsdesc_(NULL), global_offset_table_(NULL), rel_dyn_(NULL), rel_irelative_(NULL), copy_relocs_(elfcpp::R_386_COPY), @@ -14,7 +15,7 @@ diff -rupN --no-dereference binutils-2.37/gold/i386.cc binutils-2.37-new/gold/i3 { } // Process the relocations to determine unreferenced sections for -@@ -859,6 +863,21 @@ class Target_i386 : public Sized_target< +@@ -859,6 +863,21 @@ class Target_i386 : public Sized_target<32, false> this->rel_dyn_section(layout)); } @@ -36,7 +37,7 @@ diff -rupN --no-dereference binutils-2.37/gold/i386.cc binutils-2.37-new/gold/i3 // Information about this specific target which we pass to the // general Target structure. static const Target::Target_info i386_info; -@@ -898,6 +917,26 @@ class Target_i386 : public Sized_target< +@@ -898,6 +917,26 @@ class Target_i386 : public Sized_target<32, false> unsigned int got_mod_index_offset_; // True if the _TLS_MODULE_BASE_ symbol has been defined. bool tls_base_symbol_defined_; @@ -63,7 +64,7 @@ diff -rupN --no-dereference binutils-2.37/gold/i386.cc binutils-2.37-new/gold/i3 }; const Target::Target_info Target_i386::i386_info = -@@ -1042,6 +1081,126 @@ Target_i386::rel_irelative_section(Layou +@@ -1042,6 +1081,126 @@ Target_i386::rel_irelative_section(Layout* layout) return this->rel_irelative_; } diff --git a/binutils-gold-mismatched-section-flags.patch b/binutils-gold-mismatched-section-flags.patch index b61a90d..63dba2b 100644 --- a/binutils-gold-mismatched-section-flags.patch +++ b/binutils-gold-mismatched-section-flags.patch @@ -1,7 +1,7 @@ -diff -rupN --no-dereference binutils-2.37/gold/layout.cc binutils-2.37-new/gold/layout.cc ---- binutils-2.37/gold/layout.cc 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/gold/layout.cc 2021-07-24 21:59:20.710787409 +0200 -@@ -869,6 +869,7 @@ Layout::get_output_section(const char* n +diff -rup binutils.orig/gold/layout.cc binutils-2.32/gold/layout.cc +--- binutils.orig/gold/layout.cc 2019-06-24 14:37:36.013086899 +0100 ++++ binutils-2.32/gold/layout.cc 2019-06-24 14:41:40.054517479 +0100 +@@ -868,6 +868,7 @@ Layout::get_output_section(const char* n && (same_name->flags() & elfcpp::SHF_TLS) == 0) os = same_name; } @@ -9,7 +9,7 @@ diff -rupN --no-dereference binutils-2.37/gold/layout.cc binutils-2.37-new/gold/ else if ((flags & elfcpp::SHF_TLS) == 0) { elfcpp::Elf_Xword zero_flags = 0; -@@ -879,6 +880,7 @@ Layout::get_output_section(const char* n +@@ -878,6 +879,7 @@ Layout::get_output_section(const char* n if (p != this->section_name_map_.end()) os = p->second; } diff --git a/binutils-gold-warn-unsupported.patch b/binutils-gold-warn-unsupported.patch index e5e4d9e..8e00aa3 100644 --- a/binutils-gold-warn-unsupported.patch +++ b/binutils-gold-warn-unsupported.patch @@ -1,28 +1,8 @@ -diff -rupN --no-dereference binutils-2.37/bfd/config.bfd binutils-2.37-new/bfd/config.bfd ---- binutils-2.37/bfd/config.bfd 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/config.bfd 2021-07-24 21:59:24.914746464 +0200 -@@ -465,7 +465,7 @@ case "${targ}" in - ;; - - #ifdef BFD64 -- bpf-*-none) -+ bpf-*-none | bpf-*) - targ_defvec=bpf_elf64_le_vec - targ_selvecs=bpf_elf64_be_vec - targ_underscore=yes -@@ -1421,7 +1421,7 @@ case "${targ}" in - ;; - - *) -- echo 1>&2 "*** BFD does not support target ${targ}." -+ echo 1>&2 "*** BFD does not support target '${targ}'. Honest." - echo 1>&2 "*** Look in bfd/config.bfd for supported targets." - exit 1 - ;; -diff -rupN --no-dereference binutils-2.37/gold/configure binutils-2.37-new/gold/configure ---- binutils-2.37/gold/configure 2021-07-18 18:40:53.000000000 +0200 -+++ binutils-2.37-new/gold/configure 2021-07-24 21:59:24.917746435 +0200 -@@ -5184,7 +5184,8 @@ for targ in $target $canon_targets; do +Only in binutils-2.34/gold: autom4te.cache +diff -rup binutils.orig/gold/configure binutils-2.34/gold/configure +--- binutils.orig/gold/configure 2020-04-20 12:35:13.048297305 +0100 ++++ binutils-2.34/gold/configure 2020-04-20 14:02:06.743725696 +0100 +@@ -5180,7 +5180,8 @@ for targ in $target $canon_targets; do . ${srcdir}/configure.tgt if test "$targ_obj" = "UNKNOWN"; then @@ -32,9 +12,9 @@ diff -rupN --no-dereference binutils-2.37/gold/configure binutils-2.37-new/gold/ else targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)" if test "$targ_extra_obj" != ""; then -diff -rupN --no-dereference binutils-2.37/gold/configure.ac binutils-2.37-new/gold/configure.ac ---- binutils-2.37/gold/configure.ac 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/gold/configure.ac 2021-07-24 21:59:24.918746425 +0200 +diff -rup binutils.orig/gold/configure.ac binutils-2.34/gold/configure.ac +--- binutils.orig/gold/configure.ac 2020-04-20 12:35:13.050297291 +0100 ++++ binutils-2.34/gold/configure.ac 2020-04-20 14:01:46.435868770 +0100 @@ -181,7 +181,7 @@ for targ in $target $canon_targets; do . ${srcdir}/configure.tgt @@ -44,10 +24,9 @@ diff -rupN --no-dereference binutils-2.37/gold/configure.ac binutils-2.37-new/go else targetobjs="$targetobjs ${targ_obj}.\$(OBJEXT)" if test "$targ_extra_obj" != ""; then -diff -rupN --no-dereference binutils-2.37/ld/configure.tgt binutils-2.37-new/ld/configure.tgt ---- binutils-2.37/ld/configure.tgt 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/configure.tgt 2021-07-24 21:59:24.919746416 +0200 -@@ -215,7 +215,7 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfi +--- binutils.orig/ld/configure.tgt 2020-04-20 12:35:12.465301359 +0100 ++++ binutils-2.34/ld/configure.tgt 2020-04-20 14:17:52.123066333 +0100 +@@ -220,7 +220,7 @@ bfin-*-linux-uclibc*) targ_emul=elf32bfi targ_extra_emuls="elf32bfin" targ_extra_libpath=$targ_extra_emuls ;; @@ -56,7 +35,7 @@ diff -rupN --no-dereference binutils-2.37/ld/configure.tgt binutils-2.37-new/ld/ ;; cr16-*-elf*) targ_emul=elf32cr16 ;; -@@ -1025,7 +1025,7 @@ z8k-*-coff) targ_emul=z8002 +@@ -1026,7 +1026,7 @@ z8k-*-coff) targ_emul=z8002 targ_extra_ofiles= ;; *) @@ -65,3 +44,23 @@ diff -rupN --no-dereference binutils-2.37/ld/configure.tgt binutils-2.37-new/ld/ echo 2>&1 "*** see ld/configure.tgt for supported targets" exit 1 +--- binutils.orig/bfd/config.bfd 2020-04-20 12:35:13.038297375 +0100 ++++ binutils-2.34/bfd/config.bfd 2020-04-20 14:25:26.452869193 +0100 +@@ -473,7 +473,7 @@ case "${targ}" in + ;; + + #ifdef BFD64 +- bpf-*-none) ++ bpf-*-none | bpf-*) + targ_defvec=bpf_elf64_le_vec + targ_selvecs=bpf_elf64_be_vec + targ_underscore=yes +@@ -1427,7 +1427,7 @@ case "${targ}" in + ;; + + *) +- echo 1>&2 "*** BFD does not support target ${targ}." ++ echo 1>&2 "*** BFD does not support target '${targ}'. Honest." + echo 1>&2 "*** Look in bfd/config.bfd for supported targets." + exit 1 + ;; diff --git a/binutils-no-config-h-check.patch b/binutils-no-config-h-check.patch index 9a7bf1e..c89195a 100644 --- a/binutils-no-config-h-check.patch +++ b/binutils-no-config-h-check.patch @@ -1,7 +1,6 @@ -diff -rupN --no-dereference binutils-2.37/bfd/bfd-in2.h binutils-2.37-new/bfd/bfd-in2.h ---- binutils-2.37/bfd/bfd-in2.h 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/bfd-in2.h 2021-07-24 21:59:03.850951615 +0200 -@@ -30,11 +30,6 @@ +--- a/bfd/bfd-in.h 2012-08-02 10:56:34.561769686 +0100 ++++ b/bfd/bfd-in.h 2012-08-02 11:13:27.134797755 +0100 +@@ -25,11 +25,6 @@ #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ @@ -13,10 +12,9 @@ diff -rupN --no-dereference binutils-2.37/bfd/bfd-in2.h binutils-2.37-new/bfd/bf #ifdef __cplusplus extern "C" { #endif -diff -rupN --no-dereference binutils-2.37/bfd/bfd-in.h binutils-2.37-new/bfd/bfd-in.h ---- binutils-2.37/bfd/bfd-in.h 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/bfd-in.h 2021-07-24 21:59:03.851951606 +0200 -@@ -23,11 +23,6 @@ +--- a/bfd/bfd-in2.h 2012-08-02 10:56:34.349769680 +0100 ++++ b/bfd/bfd-in2.h 2012-08-02 11:13:40.015798113 +0100 +@@ -32,11 +32,6 @@ #ifndef __BFD_H_SEEN__ #define __BFD_H_SEEN__ diff --git a/binutils-readelf-other-sym-info.patch b/binutils-readelf-other-sym-info.patch index df2e324..72913ba 100644 --- a/binutils-readelf-other-sym-info.patch +++ b/binutils-readelf-other-sym-info.patch @@ -1,7 +1,6 @@ -diff -rupN --no-dereference binutils-2.37/binutils/readelf.c binutils-2.37-new/binutils/readelf.c ---- binutils-2.37/binutils/readelf.c 2021-07-24 21:59:08.033910876 +0200 -+++ binutils-2.37-new/binutils/readelf.c 2021-07-24 21:59:10.159890170 +0200 -@@ -12616,11 +12616,13 @@ print_dynamic_symbol (Filedata *filedata +--- binutils.orig/binutils/readelf.c 2020-07-24 15:08:30.317597020 +0100 ++++ binutils-2.35/binutils/readelf.c 2020-07-24 15:09:39.029155552 +0100 +@@ -12069,11 +12069,13 @@ print_dynamic_symbol (Filedata *filedata unsigned int vis = ELF_ST_VISIBILITY (psym->st_other); printf (" %-7s", get_symbol_visibility (vis)); @@ -15,7 +14,7 @@ diff -rupN --no-dereference binutils-2.37/binutils/readelf.c binutils-2.37-new/b } printf (" %4s ", get_symbol_index_type (filedata, psym->st_shndx)); -@@ -12670,7 +12672,17 @@ print_dynamic_symbol (Filedata *filedata +@@ -12112,7 +12114,17 @@ print_dynamic_symbol (Filedata *filedata version_string); } diff --git a/binutils-revert-PLT-elision.patch b/binutils-revert-PLT-elision.patch index b6d62e2..885bbee 100644 --- a/binutils-revert-PLT-elision.patch +++ b/binutils-revert-PLT-elision.patch @@ -1,27 +1,6 @@ -diff -rupN --no-dereference binutils-2.37/bfd/elfxx-x86.c binutils-2.37-new/bfd/elfxx-x86.c ---- binutils-2.37/bfd/elfxx-x86.c 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/elfxx-x86.c 2021-07-24 21:59:08.085910370 +0200 -@@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l - plt_entry_size = htab->plt.plt_entry_size; - - resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); -- -+#if 0 - /* We can't use the GOT PLT if pointer equality is needed since - finish_dynamic_symbol won't clear symbol value and the dynamic - linker won't update the GOT slot. We will get into an infinite -@@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l - /* Use the GOT PLT. */ - eh->plt_got.refcount = 1; - } -- -+#endif - /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it - here if it is defined and referenced in a non-shared object. */ - if (h->type == STT_GNU_IFUNC -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pltgot-1.d binutils-2.37-new/ld/testsuite/ld-i386/pltgot-1.d ---- binutils-2.37/ld/testsuite/ld-i386/pltgot-1.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/pltgot-1.d 2021-07-24 21:59:08.086910360 +0200 +diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d +--- binutils.orig/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 13:32:39.335065263 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-1.d 2017-11-15 15:03:55.649727195 +0000 @@ -2,6 +2,7 @@ #readelf: -S --wide #as: --32 @@ -30,9 +9,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pltgot-1.d binuti #... +\[ *[0-9]+\] \.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+10 +.* #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pltgot-2.d binutils-2.37-new/ld/testsuite/ld-i386/pltgot-2.d ---- binutils-2.37/ld/testsuite/ld-i386/pltgot-2.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/pltgot-2.d 2021-07-24 21:59:08.086910360 +0200 +diff -rup binutils.orig/ld/testsuite/ld-i386/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d +--- binutils.orig/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 13:32:39.329065335 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pltgot-2.d 2017-11-15 15:04:20.803430034 +0000 @@ -3,7 +3,6 @@ #readelf: -d --wide #as: --32 @@ -41,10 +20,10 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pltgot-2.d binuti #... +0x[0-9a-f]+ +\(PLTREL.* #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.37-new/ld/testsuite/ld-i386/pr19636-2d.d ---- binutils-2.37/ld/testsuite/ld-i386/pr19636-2d.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/pr19636-2d.d 2021-07-24 21:59:08.086910360 +0200 -@@ -8,7 +8,7 @@ Relocation section '\.rel\.dyn' at offse +diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 13:32:39.336065251 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2d.d 2017-11-15 15:03:00.413379749 +0000 +@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func @@ -53,10 +32,10 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pr19636-2d.d binu Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.37-new/ld/testsuite/ld-i386/pr19636-2e.d ---- binutils-2.37/ld/testsuite/ld-i386/pr19636-2e.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/pr19636-2e.d 2021-07-24 21:59:08.086910360 +0200 -@@ -8,7 +8,7 @@ Relocation section '\.rel\.dyn' at offse +diff -rup binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d +--- binutils.orig/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 13:32:39.330065323 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-i386/pr19636-2e.d 2017-11-15 15:03:28.928042882 +0000 +@@ -9,7 +9,7 @@ Relocation section '\.rel\.dyn' at offse [0-9a-f]+ +[0-9a-f]+ +R_386_32 +0+ +func [0-9a-f]+ +[0-9a-f]+ +R_386_PC32 +0+ +func [0-9a-f]+ +[0-9a-f]+ +R_386_GLOB_DAT +0+ +func @@ -65,21 +44,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pr19636-2e.d binu Symbol table '\.dynsym' contains [0-9]+ entries: +Num: +Value +Size Type +Bind +Vis +Ndx Name #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/pr20830.d binutils-2.37-new/ld/testsuite/ld-i386/pr20830.d ---- binutils-2.37/ld/testsuite/ld-i386/pr20830.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/pr20830.d 2021-07-24 21:59:08.087910350 +0200 -@@ -19,7 +19,7 @@ Contents of the .eh_frame section: - DW_CFA_offset: r8 \(eip\) at cfa-4 - DW_CFA_nop - DW_CFA_nop -- -+#pass - 0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133 - DW_CFA_nop - DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.37-new/ld/testsuite/ld-x86-64/pltgot-1.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pltgot-1.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pltgot-1.d 2021-07-24 21:59:08.087910350 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d +--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 13:32:39.415064300 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-1.d 2017-11-15 15:08:39.333375801 +0000 @@ -2,8 +2,4 @@ #readelf: -S --wide #as: --64 @@ -89,9 +56,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pltgot-1.d binu -#... - +\[ *[0-9]+\] \.got\.plt +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +0+18 +.* #pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.37-new/ld/testsuite/ld-x86-64/pltgot-2.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pltgot-2.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pltgot-2.d 2021-07-24 21:59:08.087910350 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d +--- binutils.orig/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 13:32:39.404064432 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pltgot-2.d 2017-11-15 15:08:59.031143095 +0000 @@ -3,7 +3,6 @@ #readelf: -d --wide #as: --64 @@ -100,17 +67,17 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pltgot-2.d binu #... +0x[0-9a-f]+ +\(PLTREL.* #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.37-new/ld/testsuite/ld-x86-64/plt-main.rd ---- binutils-2.37/ld/testsuite/ld-x86-64/plt-main.rd 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/plt-main.rd 2021-07-24 21:59:08.087910350 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd +--- binutils.orig/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 13:32:39.407064397 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/plt-main.rd 2017-11-15 15:06:17.244054423 +0000 @@ -1,4 +1,3 @@ -#failif #... [0-9a-f ]+R_X86_64_JUMP_SLOT +0+ +bar \+ 0 #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830a.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr20830a.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830a.d 2021-07-24 21:59:08.088910340 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 13:32:39.412064336 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a.d 2017-11-15 15:15:09.918750288 +0000 @@ -20,6 +20,7 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -119,9 +86,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830a.d binu 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830a-now.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr20830a-now.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830a-now.d 2021-07-24 21:59:08.088910340 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830a-now.d 2017-11-15 15:16:08.227055104 +0000 @@ -20,6 +20,7 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -130,9 +97,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830a-now.d 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830b.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr20830b.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830b.d 2021-07-24 21:59:08.088910340 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b.d 2017-11-15 15:16:20.115913358 +0000 @@ -20,7 +20,8 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -143,9 +110,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830b.d binu 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144 DW_CFA_nop DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830b-now.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr20830b-now.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr20830b-now.d 2021-07-24 21:59:08.088910340 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 13:32:39.411064348 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr20830b-now.d 2017-11-15 15:16:29.012807282 +0000 @@ -20,7 +20,8 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -156,9 +123,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr20830b-now.d 0+18 0000000000000010 0000001c FDE cie=00000000 pc=0000000000000138..0000000000000144 DW_CFA_nop DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038a.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr21038a.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038a.d 2021-07-24 21:59:08.089910331 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 13:32:39.408064384 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a.d 2017-11-15 15:19:48.097433680 +0000 @@ -19,7 +19,8 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -169,9 +136,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038a.d binu 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 DW_CFA_nop DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038a-now.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr21038a-now.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038a-now.d 2021-07-24 21:59:08.089910331 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 13:32:39.401064469 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038a-now.d 2017-11-15 15:10:56.077760324 +0000 @@ -20,7 +20,8 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -182,9 +149,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038a-now.d 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001c8..00000000000001d4 DW_CFA_nop DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038b.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr21038b.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038b.d 2021-07-24 21:59:08.089910331 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 13:32:39.405064420 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b.d 2017-11-15 15:10:42.828916844 +0000 @@ -19,6 +19,7 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -193,9 +160,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038b.d binu 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038b-now.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr21038b-now.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038b-now.d 2021-07-24 21:59:08.089910331 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 13:32:39.416064288 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038b-now.d 2017-11-15 15:11:11.550577531 +0000 @@ -20,7 +20,8 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -206,9 +173,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038b-now.d 0+18 0000000000000014 0000001c FDE cie=00000000 pc=00000000000001d8..00000000000001dd DW_CFA_nop DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038c.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr21038c.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038c.d 2021-07-24 21:59:08.089910331 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 13:32:39.411064348 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c.d 2017-11-15 15:09:52.664509478 +0000 @@ -19,7 +19,8 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -219,9 +186,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038c.d binu 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231 DW_CFA_nop DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038c-now.d ---- binutils-2.37/ld/testsuite/ld-x86-64/pr21038c-now.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/pr21038c-now.d 2021-07-24 21:59:08.090910321 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d +--- binutils.orig/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 13:32:39.413064324 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/pr21038c-now.d 2017-11-15 15:11:22.975442559 +0000 @@ -20,7 +20,8 @@ Contents of the .eh_frame section: DW_CFA_offset: r16 \(rip\) at cfa-8 DW_CFA_nop @@ -232,9 +199,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/pr21038c-now.d 0+18 0000000000000014 0000001c FDE cie=00000000 pc=0000000000000220..0000000000000231 DW_CFA_nop DW_CFA_nop -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.37-new/ld/testsuite/ld-x86-64/tlspic2.rd ---- binutils-2.37/ld/testsuite/ld-x86-64/tlspic2.rd 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/tlspic2.rd 2021-07-24 21:59:08.090910321 +0200 +diff -rup binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd +--- binutils.orig/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 13:32:39.417064276 +0000 ++++ binutils-2.29.1/ld/testsuite/ld-x86-64/tlspic2.rd 2017-11-15 15:05:02.950932110 +0000 @@ -14,6 +14,7 @@ Section Headers: +\[[ 0-9]+\] .dynsym +.* +\[[ 0-9]+\] .dynstr +.* @@ -243,3 +210,34 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/tlspic2.rd binu +\[[ 0-9]+\] .plt +.* +\[[ 0-9]+\] .plt.got +.* +\[[ 0-9]+\] .text +PROGBITS +0+1000 0+1000 0+31a 00 +AX +0 +0 4096 +--- binutils.orig/bfd/elfxx-x86.c 2018-01-22 15:59:25.875788033 +0000 ++++ binutils-2.30.0/bfd/elfxx-x86.c 2018-01-22 16:00:20.789146597 +0000 +@@ -107,7 +107,7 @@ elf_x86_allocate_dynrelocs (struct elf_l + plt_entry_size = htab->plt.plt_entry_size; + + resolved_to_zero = UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh); +- ++#if 0 + /* We can't use the GOT PLT if pointer equality is needed since + finish_dynamic_symbol won't clear symbol value and the dynamic + linker won't update the GOT slot. We will get into an infinite +@@ -125,7 +125,7 @@ elf_x86_allocate_dynrelocs (struct elf_l + /* Use the GOT PLT. */ + eh->plt_got.refcount = 1; + } +- ++#endif + /* Since STT_GNU_IFUNC symbol must go through PLT, we handle it + here if it is defined and referenced in a non-shared object. */ + if (h->type == STT_GNU_IFUNC +--- binutils.orig/ld/testsuite/ld-i386/pr20830.d 2018-07-09 09:49:51.277239857 +0100 ++++ binutils-2.30.90/ld/testsuite/ld-i386/pr20830.d 2018-07-09 10:32:41.113356733 +0100 +@@ -19,7 +19,7 @@ Contents of the .eh_frame section: + DW_CFA_offset: r8 \(eip\) at cfa-4 + DW_CFA_nop + DW_CFA_nop +- ++#pass + 0+18 00000010 0000001c FDE cie=00000000 pc=00000128..00000133 + DW_CFA_nop + DW_CFA_nop diff --git a/binutils-section-type.patch b/binutils-section-type.patch new file mode 100644 index 0000000..b8ebfa7 --- /dev/null +++ b/binutils-section-type.patch @@ -0,0 +1,369 @@ +diff --git a/bfd/bfd-in2.h b/bfd/bfd-in2.h +index 3b2a4f49a9b..78a0a1dea42 100644 +--- a/bfd/bfd-in2.h ++++ b/bfd/bfd-in2.h +@@ -1170,6 +1170,9 @@ typedef struct bfd_section + This is used when support for non-contiguous memory regions is enabled. */ + struct bfd_section *already_assigned; + ++ /* Explicitly specified section type, if non-zero. */ ++ unsigned int type; ++ + } asection; + + /* Relax table contains information about instructions which can +@@ -1352,8 +1355,8 @@ discarded_section (const asection *sec) + /* symbol, symbol_ptr_ptr, */ \ + (struct bfd_symbol *) SYM, &SEC.symbol, \ + \ +- /* map_head, map_tail, already_assigned */ \ +- { NULL }, { NULL }, NULL \ ++ /* map_head, map_tail, already_assigned, type */ \ ++ { NULL }, { NULL }, NULL, 0 \ + \ + } + +diff --git a/bfd/elf.c b/bfd/elf.c +index a67415e76e1..82b53be99f9 100644 +--- a/bfd/elf.c ++++ b/bfd/elf.c +@@ -3280,7 +3280,9 @@ elf_fake_sections (bfd *abfd, asection *asect, void *fsarg) + + /* If the section type is unspecified, we set it based on + asect->flags. */ +- if ((asect->flags & SEC_GROUP) != 0) ++ if (asect->type != 0) ++ sh_type = asect->type; ++ else if ((asect->flags & SEC_GROUP) != 0) + sh_type = SHT_GROUP; + else + sh_type = bfd_elf_get_default_section_type (asect->flags); +diff --git a/bfd/section.c b/bfd/section.c +index 899438a1c5e..2de7dbf661a 100644 +--- a/bfd/section.c ++++ b/bfd/section.c +@@ -737,8 +737,8 @@ CODE_FRAGMENT + . {* symbol, symbol_ptr_ptr, *} \ + . (struct bfd_symbol *) SYM, &SEC.symbol, \ + . \ +-. {* map_head, map_tail, already_assigned *} \ +-. { NULL }, { NULL }, NULL \ ++. {* map_head, map_tail, already_assigned, type *} \ ++. { NULL }, { NULL }, NULL, 0 \ + . \ + . } + . +diff --git a/ld/NEWS b/ld/NEWS +index dbb402d1f8a..a498abaf0f9 100644 +--- a/ld/NEWS ++++ b/ld/NEWS +@@ -1,5 +1,8 @@ + -*- text -*- + ++* TYPE= is now supported in an output section description to set the ++ section type value. ++ + Changes in 2.38: + + * Add -z pack-relative-relocs/-z no pack-relative-relocs to x86 ELF +diff --git a/ld/ld.texi b/ld/ld.texi +index fc75e9b3625..d57e9221410 100644 +--- a/ld/ld.texi ++++ b/ld/ld.texi +@@ -5483,13 +5483,23 @@ loaded into memory when the program is run. + @item READONLY + The section should be marked as read-only. + @item DSECT +-@itemx COPY +-@itemx INFO +-@itemx OVERLAY ++@item COPY ++@item INFO ++@item OVERLAY + These type names are supported for backward compatibility, and are + rarely used. They all have the same effect: the section should be + marked as not allocatable, so that no memory is allocated for the + section when the program is run. ++@item TYPE = @var{type} ++Set the section type to the integer @var{type}. When generating an ELF ++output file, type names @code{SHT_PROGBITS}, @code{SHT_STRTAB}, ++@code{SHT_NOTE}, @code {SHT_NOBITS}, @code{SHT_INIT_ARRAY}, ++@code{SHT_FINI_ARRAY}, and @code{SHT_PREINIT_ARRAY} are also allowed ++for @var{type}. It is the user's responsibility to ensure that any ++special requirements of the section type are met. ++@item READONLY ( TYPE = @var{type} ) ++This form of the syntax combines the @var{READONLY} type with the ++type specified by @var{type}. + @end table + + @kindex NOLOAD +diff --git a/ld/ldgram.y b/ld/ldgram.y +index 11c2f219c05..3a904e39482 100644 +--- a/ld/ldgram.y ++++ b/ld/ldgram.y +@@ -47,6 +47,7 @@ + #endif + + static enum section_type sectype; ++static etree_type *sectype_value; + static lang_memory_region_type *region; + + static bool ldgram_had_keep = false; +@@ -139,6 +140,7 @@ static int error_index; + %token LD_FEATURE + %token NOLOAD DSECT COPY INFO OVERLAY + %token READONLY ++%token TYPE + %token DEFINED TARGET_K SEARCH_DIR MAP ENTRY + %token NEXT + %token SIZEOF ALIGNOF ADDR LOADADDR MAX_K MIN_K +@@ -1058,9 +1060,8 @@ section: NAME + { + ldlex_popstate (); + ldlex_wild (); +- lang_enter_output_section_statement($1, $3, sectype, +- $5, $7, $4, +- $8, $6); ++ lang_enter_output_section_statement ($1, $3, sectype, ++ sectype_value, $5, $7, $4, $8, $6); + } + '{' + statement_list_opt +@@ -1130,8 +1131,10 @@ type: + | COPY { sectype = noalloc_section; } + | INFO { sectype = noalloc_section; } + | OVERLAY { sectype = noalloc_section; } ++ | READONLY '(' TYPE '=' exp ')' { sectype = typed_readonly_section; sectype_value = $5; } + | READONLY { sectype = readonly_section; } +- ; ++ | TYPE '=' exp { sectype = type_section; sectype_value = $3; } ++ ; + + atype: + '(' type ')' +diff --git a/ld/ldlang.c b/ld/ldlang.c +index 474784c874a..1733f8e65c4 100644 +--- a/ld/ldlang.c ++++ b/ld/ldlang.c +@@ -1891,8 +1891,8 @@ lang_insert_orphan (asection *s, + address = exp_intop (0); + + os_tail = (lang_output_section_statement_type **) lang_os_list.tail; +- os = lang_enter_output_section_statement (secname, address, normal_section, +- NULL, NULL, NULL, constraint, 0); ++ os = lang_enter_output_section_statement ( ++ secname, address, normal_section, 0, NULL, NULL, NULL, constraint, 0); + + if (add_child == NULL) + add_child = &os->children; +@@ -2635,10 +2635,12 @@ lang_add_section (lang_statement_list_type *ptr, + case normal_section: + case overlay_section: + case first_overlay_section: ++ case type_section: + break; + case noalloc_section: + flags &= ~SEC_ALLOC; + break; ++ case typed_readonly_section: + case readonly_section: + flags |= SEC_READONLY; + break; +@@ -4209,6 +4211,7 @@ map_input_to_output_sections + { + lang_output_section_statement_type *tos; + flagword flags; ++ unsigned int type = 0; + + switch (s->header.type) + { +@@ -4264,6 +4267,42 @@ map_input_to_output_sections + case readonly_section: + flags |= SEC_READONLY; + break; ++ case typed_readonly_section: ++ flags |= SEC_READONLY; ++ /* Fall through. */ ++ case type_section: ++ if (os->sectype_value->type.node_class == etree_name ++ && os->sectype_value->type.node_code == NAME) ++ { ++ const char *name = os->sectype_value->name.name; ++ if (strcmp (name, "SHT_PROGBITS") == 0) ++ type = SHT_PROGBITS; ++ else if (strcmp (name, "SHT_STRTAB") == 0) ++ type = SHT_STRTAB; ++ else if (strcmp (name, "SHT_NOTE") == 0) ++ type = SHT_NOTE; ++ else if (strcmp (name, "SHT_NOBITS") == 0) ++ type = SHT_NOBITS; ++ else if (strcmp (name, "SHT_INIT_ARRAY") == 0) ++ type = SHT_INIT_ARRAY; ++ else if (strcmp (name, "SHT_FINI_ARRAY") == 0) ++ type = SHT_FINI_ARRAY; ++ else if (strcmp (name, "SHT_PREINIT_ARRAY") == 0) ++ type = SHT_PREINIT_ARRAY; ++ else ++ einfo (_ ("%F%P: invalid type for output section `%s'\n"), ++ os->name); ++ } ++ else ++ { ++ exp_fold_tree_no_dot (os->sectype_value); ++ if (expld.result.valid_p) ++ type = expld.result.value; ++ else ++ einfo (_ ("%F%P: invalid type for output section `%s'\n"), ++ os->name); ++ } ++ break; + case noload_section: + if (bfd_get_flavour (link_info.output_bfd) + == bfd_target_elf_flavour) +@@ -4276,6 +4315,7 @@ map_input_to_output_sections + init_os (os, flags | SEC_READONLY); + else + os->bfd_section->flags |= flags; ++ os->bfd_section->type = type; + break; + case lang_input_section_enum: + break; +@@ -7506,6 +7546,7 @@ lang_output_section_statement_type * + lang_enter_output_section_statement (const char *output_section_statement_name, + etree_type *address_exp, + enum section_type sectype, ++ etree_type *sectype_value, + etree_type *align, + etree_type *subalign, + etree_type *ebase, +@@ -7523,10 +7564,12 @@ lang_enter_output_section_statement (const char *output_section_statement_name, + os->addr_tree = address_exp; + } + os->sectype = sectype; +- if (sectype != noload_section) +- os->flags = SEC_NO_FLAGS; +- else ++ if (sectype == type_section || sectype == typed_readonly_section) ++ os->sectype_value = sectype_value; ++ else if (sectype == noload_section) + os->flags = SEC_NEVER_LOAD; ++ else ++ os->flags = SEC_NO_FLAGS; + os->block_value = 1; + + /* Make next things chain into subchain of this. */ +@@ -8842,7 +8885,7 @@ lang_enter_overlay_section (const char *name) + etree_type *size; + + lang_enter_output_section_statement (name, overlay_vma, overlay_section, +- 0, overlay_subalign, 0, 0, 0); ++ 0, 0, overlay_subalign, 0, 0, 0); + + /* If this is the first section, then base the VMA of future + sections on this one. This will work correctly even if `.' is +diff --git a/ld/ldlang.h b/ld/ldlang.h +index 0d057c9bee9..95f6e468b30 100644 +--- a/ld/ldlang.h ++++ b/ld/ldlang.h +@@ -122,7 +122,9 @@ enum section_type + overlay_section, + noload_section, + noalloc_section, +- readonly_section ++ type_section, ++ readonly_section, ++ typed_readonly_section + }; + + /* This structure holds a list of program headers describing +@@ -166,6 +168,7 @@ typedef struct lang_output_section_statement_struct + int constraint; + flagword flags; + enum section_type sectype; ++ etree_type *sectype_value; + unsigned int processed_vma : 1; + unsigned int processed_lma : 1; + unsigned int all_input_readonly : 1; +@@ -545,7 +548,7 @@ extern void lang_add_output + (const char *, int from_script); + extern lang_output_section_statement_type *lang_enter_output_section_statement + (const char *, etree_type *, enum section_type, etree_type *, etree_type *, +- etree_type *, int, int); ++ etree_type *, etree_type *, int, int); + extern void lang_final + (void); + extern void lang_relax_sections +diff --git a/ld/ldlex.l b/ld/ldlex.l +index 78db16e3a48..c38b46b9336 100644 +--- a/ld/ldlex.l ++++ b/ld/ldlex.l +@@ -323,6 +323,7 @@ V_IDENTIFIER [*?.$_a-zA-Z\[\]\-\!\^\\]([*?.$_a-zA-Z0-9\[\]\-\!\^\\]|::)* + "DSECT" { RTOKEN(DSECT); } + "COPY" { RTOKEN(COPY); } + "INFO" { RTOKEN(INFO); } ++"TYPE" { RTOKEN(TYPE); } + "ONLY_IF_RO" { RTOKEN(ONLY_IF_RO); } + "ONLY_IF_RW" { RTOKEN(ONLY_IF_RW); } + "SPECIAL" { RTOKEN(SPECIAL); } +diff --git a/ld/mri.c b/ld/mri.c +index b428ab0d0bf..5749870ef1e 100644 +--- a/ld/mri.c ++++ b/ld/mri.c +@@ -210,8 +210,8 @@ mri_draw_tree (void) + base = p->vma ? p->vma : exp_nameop (NAME, "."); + + lang_enter_output_section_statement (p->name, base, +- p->ok_to_load ? normal_section : noload_section, +- align, subalign, NULL, 0, 0); ++ p->ok_to_load ? normal_section : noload_section, 0, ++ align, subalign, NULL, 0, 0); + base = 0; + tmp = (struct wildcard_list *) xmalloc (sizeof *tmp); + tmp->next = NULL; +diff --git a/ld/testsuite/ld-scripts/output-section-types.d b/ld/testsuite/ld-scripts/output-section-types.d +index ab124fa4dd7..2ecacaba57d 100644 +--- a/ld/testsuite/ld-scripts/output-section-types.d ++++ b/ld/testsuite/ld-scripts/output-section-types.d +@@ -1,13 +1,17 @@ + #ld: -Toutput-section-types.t + #source: align2a.s +-#objdump: -h ++#readelf: -S --wide + #target: [is_elf_format] + + #... +- . \.rom.* +-[ ]+ALLOC, READONLY +- . \.ro.* +-[ ]+CONTENTS, ALLOC, LOAD, READONLY, DATA +- . \.over.* +-[ ]+CONTENTS, READONLY ++.* .rom +NOBITS +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +00 +A +0 +0 +[1248] ++.* .ro +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +00 +A +0 +0 +[1248] ++.* .over +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +00 + +0 +0 +[1248] ++.* progbits +PROGBITS +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +00 +A +0 +0 +[1248] ++.* strtab +STRTAB +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +00 +A +0 +0 +[1248] ++.* note +NOTE +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +00 +A +0 +0 +[1248] ++.* init_array +INIT_ARRAY +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +0[48] +A +0 +0 +[1248] ++.* fini_array +FINI_ARRAY +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +0[48] +A +0 +0 +[1248] ++.* preinit_array +PREINIT_ARRAY +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +0[48] +A +0 +0 +[1248] ++.* .ro.note +NOTE +[0-9a-f]+ +[0-9a-f]+ +[0-9a-f]+ +00 +A +0 +0 +[1248] + #pass +diff --git a/ld/testsuite/ld-scripts/output-section-types.t b/ld/testsuite/ld-scripts/output-section-types.t +index d8fdfda1a03..18fc5c11980 100644 +--- a/ld/testsuite/ld-scripts/output-section-types.t ++++ b/ld/testsuite/ld-scripts/output-section-types.t +@@ -2,6 +2,13 @@ SECTIONS { + .rom (NOLOAD) : { LONG(1234); } + .ro (READONLY) : { LONG(5678); } + .over (OVERLAY) : { LONG(0123); } ++ progbits (TYPE=SHT_PROGBITS) : { BYTE(1) } ++ strtab (TYPE = SHT_STRTAB) : { BYTE(0) } ++ note (TYPE =SHT_NOTE) : { BYTE(8) } ++ init_array (TYPE= 14) : { QUAD(14) } ++ fini_array ( TYPE=SHT_FINI_ARRAY) : { QUAD(15) } ++ preinit_array (TYPE=SHT_PREINIT_ARRAY ) : { QUAD(16) } ++ .ro.note (READONLY (TYPE=SHT_NOTE)) : { LONG(5678); } + /DISCARD/ : { *(*) } + + } diff --git a/binutils-special-sections-in-groups.patch b/binutils-special-sections-in-groups.patch index 9ecb455..7de5a93 100644 --- a/binutils-special-sections-in-groups.patch +++ b/binutils-special-sections-in-groups.patch @@ -1,7 +1,6 @@ -diff -rupN --no-dereference binutils-2.37/bfd/elf.c binutils-2.37-new/bfd/elf.c ---- binutils-2.37/bfd/elf.c 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/elf.c 2021-07-24 21:59:16.679826669 +0200 -@@ -824,7 +824,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd +--- binutils.orig/bfd/elf.c 2018-10-19 11:42:10.107277490 +0100 ++++ binutils-2.31.1/bfd/elf.c 2018-10-19 11:44:33.607105801 +0100 +@@ -830,7 +830,13 @@ setup_group (bfd *abfd, Elf_Internal_Shd } } @@ -16,7 +15,7 @@ diff -rupN --no-dereference binutils-2.37/bfd/elf.c binutils-2.37-new/bfd/elf.c { /* xgettext:c-format */ _bfd_error_handler (_("%pB: no group info for section '%pA'"), -@@ -927,7 +933,8 @@ _bfd_elf_setup_sections (bfd *abfd) +@@ -936,7 +942,8 @@ _bfd_elf_setup_sections (bfd *abfd) else if (idx->shdr->bfd_section) elf_sec_group (idx->shdr->bfd_section) = shdr->bfd_section; else if (idx->shdr->sh_type != SHT_RELA diff --git a/binutils-testsuite-fixes.patch b/binutils-testsuite-fixes.patch index 15cb2c7..489071a 100644 --- a/binutils-testsuite-fixes.patch +++ b/binutils-testsuite-fixes.patch @@ -1,38 +1,165 @@ -diff -rupN --no-dereference binutils-2.37/gold/main.cc binutils-2.37-new/gold/main.cc ---- binutils-2.37/gold/main.cc 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/gold/main.cc 2021-07-24 21:59:28.964707019 +0200 -@@ -290,16 +290,6 @@ main(int argc, char** argv) - elapsed.sys / 1000, (elapsed.sys % 1000) * 1000, - elapsed.wall / 1000, (elapsed.wall % 1000) * 1000); +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-10.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-10.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-10.d 2021-02-12 10:13:11.116049499 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-10.d 2021-02-12 10:23:44.298370984 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-11.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-11.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-11.d 2021-02-12 10:13:11.119049477 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-11.d 2021-02-12 10:50:40.973828943 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-16.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-16.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-16.d 2021-02-12 10:13:11.119049477 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-16.d 2021-02-12 10:29:31.510843797 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-17.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-17.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-17.d 2021-02-12 10:13:11.116049499 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-17.d 2021-02-12 10:35:13.348404638 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-18.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-18.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-18.d 2021-02-12 10:13:11.118049484 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-18.d 2021-02-12 10:29:47.974726314 +0000 +@@ -32,7 +32,7 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-19.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-19.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-19.d 2021-02-12 10:13:11.116049499 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-19.d 2021-02-12 10:30:31.990412245 +0000 +@@ -35,9 +35,9 @@ hook called: claim_file .*/ld/testsuite/ + hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY +-Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* + #... + hook called: cleanup. + #... +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-8.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-8.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-8.d 2021-02-12 10:13:11.118049484 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-8.d 2021-02-12 10:23:18.489561148 +0000 +@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-plugin/plugin-9.d binutils-2.36.1/ld/testsuite/ld-plugin/plugin-9.d +--- binutils.orig/ld/testsuite/ld-plugin/plugin-9.d 2021-02-12 10:13:11.119049477 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-9.d 2021-02-12 10:23:34.417443785 +0000 +@@ -31,7 +31,7 @@ hook called: claim_file tmpdir/func.o \[ + hook called: claim_file tmpdir/text.o \[@0/.* not claimed + #... + hook called: all symbols read. +-Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY ++Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* + Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY + #... + hook called: cleanup. +diff -rup binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.36.1/ld/testsuite/ld-x86-64/x86-64.exp +--- binutils.orig/ld/testsuite/ld-x86-64/x86-64.exp 2021-02-12 11:44:39.121364751 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-x86-64/x86-64.exp 2021-02-12 11:46:27.505597689 +0000 +@@ -1878,24 +1878,6 @@ if { [isnative] && [check_compiler_avail + "plt-main.out" \ + "-fPIC" \ + ] \ +- [list \ +- "Run plt-main with libibtplt-lib.so -z ibtplt" \ +- "-Wl,--no-as-needed,-z,ibtplt tmpdir/libibtplt-lib.so \ +- tmpdir/libplt-lib.so" \ +- "-Wa,-mx86-used-note=yes" \ +- { plt-main5.c } \ +- "plt-main-ibt-lib" \ +- "plt-main.out" \ +- ] \ +- [list \ +- "Run plt-main with libibtplt-lib.so -z ibtplt -z now" \ +- "-Wl,--no-as-needed,-z,ibtplt,-z,now \ +- tmpdir/libibtplt-now-lib.so tmpdir/libplt-lib.so" \ +- "-Wa,-mx86-used-note=yes" \ +- { plt-main5.c } \ +- "plt-main-ibt-now-lib" \ +- "plt-main.out" \ +- ] \ + ] --#if defined(HAVE_MALLINFO2) -- struct mallinfo2 m = mallinfo2(); -- fprintf(stderr, _("%s: total space allocated by malloc: %lld bytes\n"), -- program_name, static_cast(m.arena)); --#elif defined(HAVE_MALLINFO) -- struct mallinfo m = mallinfo(); -- fprintf(stderr, _("%s: total space allocated by malloc: %lld bytes\n"), -- program_name, static_cast(m.arena)); --#endif -- - File_read::print_stats(); - Archive::print_stats(); - Lib_group::print_stats(); -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-now.d binutils-2.37-new/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-now.d ---- binutils-2.37/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-now.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-now.d 2021-07-24 21:59:28.964707019 +0200 -@@ -11,7 +11,7 @@ - 0x.+ \(PLTRELSZ\) \s+.+ \(bytes\) - 0x.+ \(PLTREL\) \s+RELA - 0x.+ \(JMPREL\) \s+0x.+ -- 0x.+ \(BIND_NOW\) \s+ -+ 0x.+ \(FLAGS\) \s+BIND_NOW - 0x.+ \(FLAGS_1\) \s+ Flags: NOW - 0x.+ \(NULL\) \s+ 0x0 + if { [check_ifunc_attribute_available] } { +@@ -1922,7 +1904,6 @@ if { [isnative] && [check_compiler_avail + } + } -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-now.d binutils-2.37-new/ld/testsuite/ld-aarch64/variant_pcs-now.d ---- binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-07-24 21:59:28.965707009 +0200 +- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "" + undefined_weak "-fPIE" "-pie" + undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak" +--- binutils.orig/ld/testsuite/ld-plugin/plugin-12.d 2021-02-12 11:44:39.076365068 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-12.d 2021-02-12 12:01:48.091931654 +0000 +@@ -1,5 +1,5 @@ + #... +-.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DEF ++.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* + .*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY + .*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY + .*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY +--- binutils.orig/ld/testsuite/ld-plugin/plugin-12.d 2021-02-12 14:14:25.023160021 +0000 ++++ binutils-2.36.1/ld/testsuite/ld-plugin/plugin-12.d 2021-02-12 14:19:29.106923745 +0000 +@@ -1,6 +1,6 @@ + #... +-.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* +-.*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY +-.*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY +-.*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `.*unc' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* ++.*: symbol `.*unc1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `.*unc2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY ++.*: symbol `.*unc3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY + #pass +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-07-19 12:39:14.240555833 +0100 ++++ binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-now.d 2021-07-19 12:50:27.753751551 +0100 @@ -23,10 +23,10 @@ Symbol table '\.dynsym' contains 7 entri Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND @@ -85,9 +212,8 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-no - 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def + 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT .* 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-r.d binutils-2.37-new/ld/testsuite/ld-aarch64/variant_pcs-r.d ---- binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-07-24 21:59:28.965707009 +0200 +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-07-19 12:39:14.235555861 +0100 ++++ binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-r.d 2021-07-19 12:51:04.981541273 +0100 @@ -37,24 +37,24 @@ Symbol table '\.symtab' contains 26 entr 2: 0000000000000000 0 SECTION LOCAL DEFAULT 3.* 3: 0000000000000000 0 SECTION LOCAL DEFAULT 4.* @@ -122,9 +248,8 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-r. - 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def + 24: 0000000000000000 0 NOTYPE GLOBAL DEFAULT .* 25: 0000000000000000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-shared.d binutils-2.37-new/ld/testsuite/ld-aarch64/variant_pcs-shared.d ---- binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-07-24 21:59:28.978706882 +0200 +--- binutils.orig/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-07-19 12:39:14.235555861 +0100 ++++ binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-shared.d 2021-07-19 12:51:38.076354339 +0100 @@ -23,10 +23,10 @@ Symbol table '\.dynsym' contains 7 entri Num: Value Size Type Bind Vis Ndx Name 0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND @@ -177,20 +302,69 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-aarch64/variant_pcs-sh - 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT \[VARIANT_PCS\] 1 f_spec_global_default_def + 33: 0000000000008000 0 NOTYPE GLOBAL DEFAULT .* 34: 0000000000008000 0 IFUNC GLOBAL DEFAULT 1 f_base_global_default_ifunc -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elf/compress.exp binutils-2.37-new/ld/testsuite/ld-elf/compress.exp ---- binutils-2.37/ld/testsuite/ld-elf/compress.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-elf/compress.exp 2021-07-24 21:59:28.978706882 +0200 -@@ -167,8 +167,8 @@ if { [regexp_diff tmpdir/$test.out $srcd +--- binutils.orig/gold/main.cc 2021-07-19 12:39:14.643553557 +0100 ++++ binutils-2.37/gold/main.cc 2021-07-19 12:53:40.043665415 +0100 +@@ -290,16 +290,6 @@ main(int argc, char** argv) + elapsed.sys / 1000, (elapsed.sys % 1000) * 1000, + elapsed.wall / 1000, (elapsed.wall % 1000) * 1000); + +-#if defined(HAVE_MALLINFO2) +- struct mallinfo2 m = mallinfo2(); +- fprintf(stderr, _("%s: total space allocated by malloc: %lld bytes\n"), +- program_name, static_cast(m.arena)); +-#elif defined(HAVE_MALLINFO) +- struct mallinfo m = mallinfo(); +- fprintf(stderr, _("%s: total space allocated by malloc: %lld bytes\n"), +- program_name, static_cast(m.arena)); +-#endif +- + File_read::print_stats(); + Archive::print_stats(); + Lib_group::print_stats(); +--- binutils.orig/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-now.d 2021-07-19 14:51:48.859666911 +0100 ++++ binutils-2.37/ld/testsuite/ld-aarch64/tls-relax-gdesc-le-now.d 2021-07-19 14:59:56.130065901 +0100 +@@ -11,7 +11,7 @@ + 0x.+ \(PLTRELSZ\) \s+.+ \(bytes\) + 0x.+ \(PLTREL\) \s+RELA + 0x.+ \(JMPREL\) \s+0x.+ +- 0x.+ \(BIND_NOW\) \s+ ++ 0x.+ \(FLAGS\) \s+BIND_NOW + 0x.+ \(FLAGS_1\) \s+ Flags: NOW + 0x.+ \(NULL\) \s+ 0x0 + +--- binutils.orig/ld/testsuite/ld-plugin/plugin.exp 2021-07-19 14:51:48.905666659 +0100 ++++ binutils-2.37/ld/testsuite/ld-plugin/plugin.exp 2021-07-19 15:06:56.159875135 +0100 +@@ -119,7 +119,7 @@ if { $can_compile && !$failed_compile } + + # I do not know why, but the underscore prefix test is going + # wrong on ppc64le targets. So override it here. +-if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } { ++if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] || [istarget *-*-*] } { + set _ "" + } +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-07-19 14:51:48.982666235 +0100 ++++ binutils-2.37/ld/testsuite/ld-elf/compress.exp 2021-07-19 15:16:14.268931663 +0100 +@@ -168,7 +168,7 @@ if { [regexp_diff tmpdir/$test.out $srcd set test_name "Link with zlib compressed debug output 1" set test normal --send_log "$READELF -w tmpdir/$test > tmpdir/$test.out\n" + send_log "$READELF -w tmpdir/$test > tmpdir/$test.out\n" -set got [remote_exec host [concat sh -c [list "$READELF -w tmpdir/$test > tmpdir/$test.out"]] "" "/dev/null"] -+send_log "$READELF -wi tmpdir/$test > tmpdir/$test.out\n" +set got [remote_exec host [concat sh -c [list "$READELF -wi tmpdir/$test > tmpdir/$test.out"]] "" "/dev/null"] if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { send_log "$got\n" fail "$test_name" +--- binutils.orig/ld/testsuite/ld-elf/compress.exp 2021-07-20 09:55:20.387674258 +0100 ++++ binutils-2.37/ld/testsuite/ld-elf/compress.exp 2021-07-20 09:59:51.118189655 +0100 +@@ -167,7 +167,7 @@ if { [regexp_diff tmpdir/$test.out $srcd + + set test_name "Link with zlib compressed debug output 1" + set test normal +-send_log "$READELF -w tmpdir/$test > tmpdir/$test.out\n" ++send_log "$READELF -wi tmpdir/$test > tmpdir/$test.out\n" + set got [remote_exec host [concat sh -c [list "$READELF -wi tmpdir/$test > tmpdir/$test.out"]] "" "/dev/null"] + if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { + send_log "$got\n" @@ -176,8 +176,8 @@ if { [lindex $got 0] != 0 || ![string ma set test_name "Link with zlib compressed debug output 2" @@ -224,36 +398,9 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elf/compress.exp binut if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { send_log "$got\n" fail "$test_name" -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elf/pr26580-3.out binutils-2.37-new/ld/testsuite/ld-elf/pr26580-3.out ---- binutils-2.37/ld/testsuite/ld-elf/pr26580-3.out 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-elf/pr26580-3.out 2021-07-24 21:59:28.979706873 +0200 -@@ -1,2 +1,2 @@ - library not loaded --alignment 1 -+alignment . -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elf/shared.exp binutils-2.37-new/ld/testsuite/ld-elf/shared.exp ---- binutils-2.37/ld/testsuite/ld-elf/shared.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-elf/shared.exp 2021-07-24 21:59:28.979706873 +0200 -@@ -1536,18 +1536,6 @@ if { [istarget *-*-linux*] - "pr22393-2-static" \ - "pass.out" \ - ] \ -- [list \ -- "Run pr21964-4" \ -- "" \ -- "" \ -- {pr21964-4.c} \ -- "pr21964-4" \ -- "pass.out" \ -- "" \ -- "" \ -- "" \ -- "-ldl" \ -- ] \ - ] - } - -@@ -1629,6 +1617,7 @@ if [istarget "sparc*-*-*"] { +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-07-20 09:55:20.398674198 +0100 ++++ binutils-2.37/ld/testsuite/ld-elf/shared.exp 2021-07-20 10:04:13.180751421 +0100 +@@ -1629,6 +1629,7 @@ if [istarget "sparc*-*-*"] { if { ([istarget "*-*-linux*"] || [istarget "*-*-nacl*"] || [istarget "*-*-gnu*"]) @@ -261,36 +408,8 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elf/shared.exp binutil && ![istarget "mips*-*-*"] } { run_ld_link_tests [list \ [list \ -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elf/tls.exp binutils-2.37-new/ld/testsuite/ld-elf/tls.exp ---- binutils-2.37/ld/testsuite/ld-elf/tls.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-elf/tls.exp 2021-07-24 21:59:28.979706873 +0200 -@@ -32,6 +32,9 @@ if { !([istarget *-*-linux*] - if { ![check_compiler_available] } { - return - } -+if { [istarget s390x*-*-*] } { -+ return -+} - - # This target requires extra GAS options when building PIC/PIE code. - set AFLAGS_PIC "" -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-elfvsb/elfvsb.exp binutils-2.37-new/ld/testsuite/ld-elfvsb/elfvsb.exp ---- binutils-2.37/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-elfvsb/elfvsb.exp 2021-07-24 21:59:28.980706863 +0200 -@@ -94,6 +94,10 @@ if { [istarget *-*-linux*] - } - } - -+if { [istarget i686*-*-*] } { -+ set support_protected "no" -+} -+ - # The test procedure. - proc visibility_test { visibility progname testname main sh1 sh2 dat args } { - global CC -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-gc/pr13683.d binutils-2.37-new/ld/testsuite/ld-gc/pr13683.d ---- binutils-2.37/ld/testsuite/ld-gc/pr13683.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-gc/pr13683.d 2021-07-24 21:59:28.980706863 +0200 +--- binutils.orig/ld/testsuite/ld-gc/pr13683.d 2021-07-20 09:55:20.295674760 +0100 ++++ binutils-2.37/ld/testsuite/ld-gc/pr13683.d 2021-07-20 10:10:30.650663650 +0100 @@ -2,7 +2,7 @@ #source: dummy.s #ld: --gc-sections -e main --defsym foo=foo2 tmpdir/pr13683.o @@ -300,9 +419,8 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-gc/pr13683.d binutils- # Note - look for both "foo" and "foo2" being defined, non-zero function symbols -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-gc/pr19161.d binutils-2.37-new/ld/testsuite/ld-gc/pr19161.d ---- binutils-2.37/ld/testsuite/ld-gc/pr19161.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-gc/pr19161.d 2021-07-24 21:59:28.980706863 +0200 +--- binutils.orig/ld/testsuite/ld-gc/pr19161.d 2021-07-20 09:55:20.295674760 +0100 ++++ binutils-2.37/ld/testsuite/ld-gc/pr19161.d 2021-07-20 10:12:36.585966659 +0100 @@ -2,7 +2,7 @@ #source: dummy.s #ld: --gc-sections -e main tmpdir/pr19161-1.o tmpdir/pr19161-2.o @@ -312,9 +430,30 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-gc/pr19161.d binutils- #xfail: mips64vr-*-* msp430-*-* powerpc*-*-eabivle rl78-*-* rx-*-* sh*-*-* #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/i386.exp binutils-2.37-new/ld/testsuite/ld-i386/i386.exp ---- binutils-2.37/ld/testsuite/ld-i386/i386.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/i386.exp 2021-07-24 21:59:28.981706853 +0200 +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-20 09:55:20.315674651 +0100 ++++ binutils-2.37/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-20 10:15:51.096886972 +0100 +@@ -664,6 +664,11 @@ run_cc_link_tests [list \ + ] \ + ] + ++if { [isnative] ++ && !([istarget "powerpc-*-*"] ++ || [istarget "aarch64*-*-*"] || [istarget "arm*-*-*"] ++ || [istarget "sparc*-*-*"] ++ || [istarget "riscv*-*-*"]) } { + run_ld_link_exec_tests [list \ + [list \ + "Run pr18808" \ +@@ -714,6 +719,7 @@ run_ld_link_exec_tests [list \ + "pr18841.out" \ + ] \ + ] ++} + + # The pr23169 testcase is not valid. In general, you can't call ifunc + # resolvers in another binary unless you know what you're doing. In +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2021-07-20 13:28:42.211613869 +0100 ++++ binutils-2.37/ld/testsuite/ld-i386/i386.exp 2021-07-20 13:40:00.116839084 +0100 @@ -1057,15 +1057,6 @@ if { [isnative] "pr18900.out" \ ] \ @@ -331,37 +470,23 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/i386.exp binutils "Run got1" \ "$NOPIE_LDFLAGS tmpdir/got1d.so" \ "-Wa,-mx86-used-note=yes" \ -@@ -1117,7 +1108,9 @@ if { [isnative] +@@ -1117,6 +1108,7 @@ if { [isnative] ] \ ] -- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" -+ if { ! [istarget i686*-*-*] } { -+ undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" -+ } ++ setup_xfail i686*-*-* + undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" undefined_weak "-fPIE" "$NOPIE_LDFLAGS" undefined_weak "-fPIE" "-pie" - undefined_weak "-fPIE" "-z nodynamic-undefined-weak $NOPIE_LDFLAGS" -@@ -1181,7 +1174,7 @@ if { [isnative] - ] \ - ] - -- if { [istarget "i?86-*-linux*"] } { -+ if { [istarget "i?86-*-linux*"] && ! [istarget i686*-*-*] } { - run_cc_link_tests [list \ - [list \ - "Build pr21168.so with -z ibtplt" \ -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/plt-main.rd binutils-2.37-new/ld/testsuite/ld-i386/plt-main.rd ---- binutils-2.37/ld/testsuite/ld-i386/plt-main.rd 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/plt-main.rd 2021-07-24 21:59:28.981706853 +0200 +--- binutils.orig/ld/testsuite/ld-i386/plt-main.rd 2021-07-20 13:28:42.214613852 +0100 ++++ binutils-2.37/ld/testsuite/ld-i386/plt-main.rd 2021-07-20 13:39:25.781030283 +0100 @@ -1,4 +1 @@ -#failif -#... -[0-9a-f ]+R_386_JUMP_SLOT +0+ +bar #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/plt-pie-ibt.dd binutils-2.37-new/ld/testsuite/ld-i386/plt-pie-ibt.dd ---- binutils-2.37/ld/testsuite/ld-i386/plt-pie-ibt.dd 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-i386/plt-pie-ibt.dd 2021-07-24 21:59:28.981706853 +0200 +--- binutils.orig/ld/testsuite/ld-i386/plt-pie-ibt.dd 2021-07-20 13:28:42.211613869 +0100 ++++ binutils-2.37/ld/testsuite/ld-i386/plt-pie-ibt.dd 2021-07-20 13:42:32.515990374 +0100 @@ -1,7 +1,2 @@ #... -Disassembly of section .plt.got: @@ -370,209 +495,97 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-i386/plt-pie-ibt.dd bi -[ ]*[a-f0-9]+: f3 0f 1e fb endbr32 -[ ]*[a-f0-9]+: ff a3 .. .. .. .. jmp +\*\-0x[a-f0-9]+\(%ebx\) #pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-ifunc/ifunc.exp binutils-2.37-new/ld/testsuite/ld-ifunc/ifunc.exp ---- binutils-2.37/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-24 21:59:28.981706853 +0200 -@@ -39,6 +39,8 @@ if { ![is_elf_format] || ![supports_gnu_ - || [istarget nds32*-*-*] - || [istarget nios2-*-*] - || [istarget or1k-*-*] -+ || [istarget powerpc*-*-*] -+ || [istarget ppc*-*-*] - || [istarget score*-*-*] - || [istarget sh*-*-*] - || [istarget tic6x-*-*] -@@ -664,6 +666,11 @@ run_cc_link_tests [list \ - ] \ - ] +--- binutils.orig/ld/testsuite/ld-scripts/crossref.exp 2021-07-20 13:28:42.114614409 +0100 ++++ binutils-2.37/ld/testsuite/ld-scripts/crossref.exp 2021-07-20 13:45:27.476015992 +0100 +@@ -147,6 +147,8 @@ set exec_output [prune_warnings $exec_ou -+if { [isnative] -+ && !([istarget "powerpc-*-*"] -+ || [istarget "aarch64*-*-*"] || [istarget "arm*-*-*"] -+ || [istarget "sparc*-*-*"] -+ || [istarget "riscv*-*-*"]) } { - run_ld_link_exec_tests [list \ - [list \ - "Run pr18808" \ -@@ -714,6 +721,7 @@ run_ld_link_exec_tests [list \ - "pr18841.out" \ - ] \ - ] -+} + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output - # The pr23169 testcase is not valid. In general, you can't call ifunc - # resolvers in another binary unless you know what you're doing. In -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-10.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-10.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-10.d 2021-07-24 21:59:20.653787965 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-10.d 2021-07-24 21:59:28.982706843 +0200 -@@ -32,7 +32,7 @@ hook called: claim_file tmpdir/func.o \[ - hook called: claim_file tmpdir/libtext.a \[@.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY - #... - hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-11.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-11.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-11.d 2021-07-24 21:59:20.653787965 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-11.d 2021-07-24 21:59:28.982706843 +0200 -@@ -35,9 +35,9 @@ hook called: claim_file tmpdir/func.o \[ - hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY --Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* - #... - hook called: cleanup. - #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-12.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-12.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-12.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-12.d 2021-07-24 21:59:28.982706843 +0200 -@@ -1,6 +1,6 @@ - #... --.*: symbol `func' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DEF --.*: symbol `func1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY --.*: symbol `func2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY --.*: symbol `func3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY -+.*: symbol `.*unc' definition: DEF, visibility: DEFAULT, resolution: PREVAILING_DE.* -+.*: symbol `.*unc1' definition: DEF, visibility: PROTECTED, resolution: PREVAILING_DEF_IRONLY -+.*: symbol `.*unc2' definition: DEF, visibility: INTERNAL, resolution: PREVAILING_DEF_IRONLY -+.*: symbol `.*unc3' definition: DEF, visibility: HIDDEN, resolution: PREVAILING_DEF_IRONLY - #pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-16.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-16.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-16.d 2021-07-24 21:59:20.654787955 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-16.d 2021-07-24 21:59:28.982706843 +0200 -@@ -30,7 +30,7 @@ hook called: claim_file .*/ld/testsuite/ - hook called: claim_file tmpdir/text.o \[@0/.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY - #... - hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-17.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-17.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-17.d 2021-07-24 21:59:20.654787955 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-17.d 2021-07-24 21:59:28.983706834 +0200 -@@ -31,7 +31,7 @@ hook called: claim_file .*/ld/testsuite/ - hook called: claim_file tmpdir/text.o \[@0/.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY - #... - hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-18.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-18.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-18.d 2021-07-24 21:59:20.654787955 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-18.d 2021-07-24 21:59:28.983706834 +0200 -@@ -32,7 +32,7 @@ hook called: claim_file .*/ld/testsuite/ - hook called: claim_file tmpdir/libtext.a \[@.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY - #... - hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-19.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-19.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-19.d 2021-07-24 21:59:20.654787955 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-19.d 2021-07-24 21:59:28.983706834 +0200 -@@ -35,9 +35,9 @@ hook called: claim_file .*/ld/testsuite/ - hook called: claim_file tmpdir/libtext.a \[@.* CLAIMED - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY --Sym: '_?text' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?text' Resolution: LDPR_PREVAILING_DE.* - #... - hook called: cleanup. - #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-8.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-8.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-8.d 2021-07-24 21:59:20.657787926 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-8.d 2021-07-24 21:59:28.983706834 +0200 -@@ -30,7 +30,7 @@ hook called: claim_file tmpdir/func.o \[ - hook called: claim_file tmpdir/text.o \[@0/.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY - #... - hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin-9.d binutils-2.37-new/ld/testsuite/ld-plugin/plugin-9.d ---- binutils-2.37/ld/testsuite/ld-plugin/plugin-9.d 2021-07-24 21:59:20.657787926 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin-9.d 2021-07-24 21:59:28.983706834 +0200 -@@ -31,7 +31,7 @@ hook called: claim_file tmpdir/func.o \[ - hook called: claim_file tmpdir/text.o \[@0/.* not claimed - #... - hook called: all symbols read. --Sym: '_?func' Resolution: LDPR_PREVAILING_DEF_IRONLY -+Sym: '_?func' Resolution: LDPR_PREVAILING_DE.* - Sym: '_?func2' Resolution: LDPR_PREVAILING_DEF_IRONLY - #... - hook called: cleanup. -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-plugin/plugin.exp binutils-2.37-new/ld/testsuite/ld-plugin/plugin.exp ---- binutils-2.37/ld/testsuite/ld-plugin/plugin.exp 2021-07-24 21:59:20.657787926 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-plugin/plugin.exp 2021-07-24 21:59:28.984706824 +0200 -@@ -81,6 +81,7 @@ if { [istarget m681*-*-*] || [istarget m - # otherwise get FAILS due to _.frame - set CFLAGS "$CFLAGS -fomit-frame-pointer" - } ++setup_xfail i686*-*-* + - # In order to define symbols in plugin options in the list of tests below, - # we need to know if the platform prepends an underscore to C symbols, - # which we find out by compiling the test objects now. If there is any -@@ -119,7 +120,7 @@ if { $can_compile && !$failed_compile } + if [string match "" $exec_output] then { + pass $test3 + } else { +@@ -187,6 +189,8 @@ set exec_output [prune_warnings $exec_ou - # I do not know why, but the underscore prefix test is going - # wrong on ppc64le targets. So override it here. --if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] } { -+if { [istarget powerpc*-*-linux*] || [istarget x86_64*-*-linux*] || [istarget *-*-*] } { - set _ "" - } + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output -@@ -137,6 +138,9 @@ if [is_pecoff_format] { - #otherwise relocs overflow to symbols defined on the command line - append libs " --image-base=0x10000000" - } -+if { [istarget aarch64*-*-*] || [istarget arm*-*-*] } { -+ append libs " --defsym __aeabi_unwind_cpp_pr0=0" -+} ++setup_xfail i686*-*-* ++ + if [string match "" $exec_output] then { + pass $test6 + } else { +@@ -199,6 +203,8 @@ set exec_output [prune_warnings $exec_ou - set plugin_tests [list \ - [list "load plugin" "-plugin $plugin_path \ -@@ -304,6 +308,7 @@ if { !$can_compile || $failed_compile } - run_ld_link_tests $plugin_tests - - if { [is_elf_format] \ -+ && ! [istarget ppc64*-*-*] && ! [istarget powerpc*-*-*] - && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func1p.c tmpdir/func1p.o] \ - && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func2i.c tmpdir/func2i.o] \ - && [ld_compile "$CC $CFLAGS" $srcdir/$subdir/func3h.c tmpdir/func3h.o] } { -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/group1.sym binutils-2.37-new/ld/testsuite/ld-powerpc/group1.sym ---- binutils-2.37/ld/testsuite/ld-powerpc/group1.sym 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-powerpc/group1.sym 2021-07-24 21:59:28.984706824 +0200 -@@ -1,3 +1 @@ --#... + regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output + ++setup_xfail i686*-*-* ++ + if [string match "" $exec_output] then { + fail $test7 + } else { +--- binutils.orig/ld/testsuite/ld-shared/shared.exp 2021-07-20 13:28:42.168614108 +0100 ++++ binutils-2.37/ld/testsuite/ld-shared/shared.exp 2021-07-20 13:46:57.073516995 +0100 +@@ -36,9 +36,6 @@ if { ![istarget hppa*64*-*-hpux*] \ + && ![istarget hppa*-*-linux*] \ + && ![istarget i?86-*-sysv4*] \ + && ![istarget i?86-*-unixware] \ +- && ![istarget i?86-*-elf*] \ +- && ![istarget i?86-*-linux*] \ +- && ![istarget i?86-*-gnu*] \ + && ![istarget *-*-nacl*] \ + && ![istarget ia64-*-elf*] \ + && ![istarget ia64-*-linux*] \ +--- binutils.orig/ld/testsuite/ld-i386/i386.exp 2021-07-20 15:22:27.898561717 +0100 ++++ binutils-2.37/ld/testsuite/ld-i386/i386.exp 2021-07-20 15:24:39.121829544 +0100 +@@ -1108,8 +1108,9 @@ if { [isnative] + ] \ + ] + +- setup_xfail i686*-*-* +- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" ++ if { ! [istarget i686*-*-*] } { ++ undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" ++ } + undefined_weak "-fPIE" "$NOPIE_LDFLAGS" + undefined_weak "-fPIE" "-pie" + undefined_weak "-fPIE" "-z nodynamic-undefined-weak $NOPIE_LDFLAGS" +@@ -1173,7 +1174,7 @@ if { [isnative] + ] \ + ] + +- if { [istarget "i?86-*-linux*"] } { ++ if { [istarget "i?86-*-linux*"] && ! [istarget i686*-*-*] } { + run_cc_link_tests [list \ + [list \ + "Build pr21168.so with -z ibtplt" \ +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-20 15:22:27.806562231 +0100 ++++ binutils-2.37/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-20 15:28:03.248690669 +0100 +@@ -39,6 +39,7 @@ if { ![is_elf_format] || ![supports_gnu_ + || [istarget nds32*-*-*] + || [istarget nios2-*-*] + || [istarget or1k-*-*] ++ || [istarget ppc*-*-*] + || [istarget score*-*-*] + || [istarget sh*-*-*] + || [istarget tic6x-*-*] +diff -rup binutils.orig/ld/testsuite/ld-powerpc/group1.sym binutils-2.37/ld/testsuite/ld-powerpc/group1.sym +--- binutils.orig/ld/testsuite/ld-powerpc/group1.sym 2021-07-20 15:22:27.827562114 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/group1.sym 2021-07-20 15:39:57.916703418 +0100 +@@ -1,3 +1,2 @@ + #... -.* 8 FUNC +GLOBAL DEFAULT \[: 4\] +1 foo #pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/group3.sym binutils-2.37-new/ld/testsuite/ld-powerpc/group3.sym ---- binutils-2.37/ld/testsuite/ld-powerpc/group3.sym 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-powerpc/group3.sym 2021-07-24 21:59:28.984706824 +0200 -@@ -1,3 +1 @@ --#... +diff -rup binutils.orig/ld/testsuite/ld-powerpc/group3.sym binutils-2.37/ld/testsuite/ld-powerpc/group3.sym +--- binutils.orig/ld/testsuite/ld-powerpc/group3.sym 2021-07-20 15:22:27.825562125 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/group3.sym 2021-07-20 15:40:13.388617110 +0100 +@@ -1,3 +1,2 @@ + #... -.* 4 FUNC +GLOBAL DEFAULT \[: 1\] +1 foo #pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/notoc3.d binutils-2.37-new/ld/testsuite/ld-powerpc/notoc3.d ---- binutils-2.37/ld/testsuite/ld-powerpc/notoc3.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-powerpc/notoc3.d 2021-07-24 21:59:28.984706824 +0200 +diff -rup binutils.orig/ld/testsuite/ld-powerpc/notoc3.d binutils-2.37/ld/testsuite/ld-powerpc/notoc3.d +--- binutils.orig/ld/testsuite/ld-powerpc/notoc3.d 2021-07-20 15:22:27.824562131 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/notoc3.d 2021-07-20 15:39:16.508934455 +0100 @@ -58,7 +58,7 @@ Disassembly of section \.text: .* : @@ -599,30 +612,18 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/notoc3.d binut +8000000000000004:.* 8000000000000008: (00 00 00 60|60 00 00 00) nop 800000000000000c: (20 00 80 4e|4e 80 00 20) blr -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/pr23937.d binutils-2.37-new/ld/testsuite/ld-powerpc/pr23937.d ---- binutils-2.37/ld/testsuite/ld-powerpc/pr23937.d 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-powerpc/pr23937.d 2021-07-24 21:59:28.985706814 +0200 -@@ -5,6 +5,4 @@ - +diff -rup binutils.orig/ld/testsuite/ld-powerpc/pr23937.d binutils-2.37/ld/testsuite/ld-powerpc/pr23937.d +--- binutils.orig/ld/testsuite/ld-powerpc/pr23937.d 2021-07-20 15:22:27.828562108 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/pr23937.d 2021-07-20 15:40:52.012401643 +0100 +@@ -6,5 +6,4 @@ #... .* R_PPC64_IRELATIVE +10000180 --#... + #... -.*: 0+10000180 +20 IFUNC +LOCAL +DEFAULT .* magic #pass -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32no.r binutils-2.37-new/ld/testsuite/ld-powerpc/tlsexe32no.r ---- binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32no.r 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-powerpc/tlsexe32no.r 2021-07-24 21:59:28.985706814 +0200 -@@ -22,6 +22,7 @@ Section Headers: - +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 08 +WA +4 +0 +4 - +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000038 04 +WA +0 +0 +4 - +\[[ 0-9]+\] \.plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000004 00 +WA +0 +0 +4 -+#pass - +\[[ 0-9]+\] \.symtab +SYMTAB +.* - +\[[ 0-9]+\] \.strtab +STRTAB +.* - +\[[ 0-9]+\] \.shstrtab +STRTAB +.* -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32.r binutils-2.37-new/ld/testsuite/ld-powerpc/tlsexe32.r ---- binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32.r 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-powerpc/tlsexe32.r 2021-07-24 21:59:28.986706805 +0200 +diff -rup binutils.orig/ld/testsuite/ld-powerpc/tlsexe32.r binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32.r +--- binutils.orig/ld/testsuite/ld-powerpc/tlsexe32.r 2021-07-20 15:22:27.824562131 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32.r 2021-07-20 15:35:59.630032873 +0100 @@ -22,7 +22,8 @@ Section Headers: +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 08 +WA +4 +0 +4 +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000018 04 +WA +0 +0 +4 @@ -633,9 +634,20 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32.r bin +\[[ 0-9]+\] \.strtab +STRTAB +.* +\[[ 0-9]+\] \.shstrtab +STRTAB +.* #... -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/tlsso32.r binutils-2.37-new/ld/testsuite/ld-powerpc/tlsso32.r ---- binutils-2.37/ld/testsuite/ld-powerpc/tlsso32.r 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-powerpc/tlsso32.r 2021-07-24 21:59:28.986706805 +0200 +diff -rup binutils.orig/ld/testsuite/ld-powerpc/tlsexe32no.r binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32no.r +--- binutils.orig/ld/testsuite/ld-powerpc/tlsexe32no.r 2021-07-20 15:22:27.826562119 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/tlsexe32no.r 2021-07-20 15:36:34.541838084 +0100 +@@ -22,6 +22,7 @@ Section Headers: + +\[[ 0-9]+\] \.dynamic +DYNAMIC +[0-9a-f]+ [0-9a-f]+ [0-9a-f]+ 08 +WA +4 +0 +4 + +\[[ 0-9]+\] \.got +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000038 04 +WA +0 +0 +4 + +\[[ 0-9]+\] \.plt +PROGBITS +[0-9a-f]+ [0-9a-f]+ 000004 00 +WA +0 +0 +4 ++#pass + +\[[ 0-9]+\] \.symtab +SYMTAB +.* + +\[[ 0-9]+\] \.strtab +STRTAB +.* + +\[[ 0-9]+\] \.shstrtab +STRTAB +.* +diff -rup binutils.orig/ld/testsuite/ld-powerpc/tlsso32.r binutils-2.37/ld/testsuite/ld-powerpc/tlsso32.r +--- binutils.orig/ld/testsuite/ld-powerpc/tlsso32.r 2021-07-20 15:22:27.825562125 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/tlsso32.r 2021-07-20 15:37:05.434665742 +0100 @@ -20,6 +20,7 @@ Section Headers: +\[[ 0-9]+\] \.dynamic +DYNAMIC .* 08 +WA +3 +0 +4 +\[[ 0-9]+\] \.got +PROGBITS .* 0+40 04 +WA +0 +0 +4 @@ -644,222 +656,85 @@ diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-powerpc/tlsso32.r binu +\[[ 0-9]+\] \.symtab +.* +\[[ 0-9]+\] \.strtab +.* +\[[ 0-9]+\] \.shstrtab +.* -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-scripts/crossref.exp binutils-2.37-new/ld/testsuite/ld-scripts/crossref.exp ---- binutils-2.37/ld/testsuite/ld-scripts/crossref.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-scripts/crossref.exp 2021-07-24 21:59:28.986706805 +0200 -@@ -147,6 +147,8 @@ set exec_output [prune_warnings $exec_ou - - regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output - -+setup_xfail i686*-*-* -+ - if [string match "" $exec_output] then { - pass $test3 - } else { -@@ -187,6 +189,8 @@ set exec_output [prune_warnings $exec_ou - - regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output +--- binutils.orig/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-20 16:24:17.370869076 +0100 ++++ binutils-2.37/ld/testsuite/ld-ifunc/ifunc.exp 2021-07-20 16:24:31.069792658 +0100 +@@ -39,6 +39,7 @@ if { ![is_elf_format] || ![supports_gnu_ + || [istarget nds32*-*-*] + || [istarget nios2-*-*] + || [istarget or1k-*-*] ++ || [istarget powerpc*-*-*] + || [istarget ppc*-*-*] + || [istarget score*-*-*] + || [istarget sh*-*-*] +--- binutils.orig/ld/testsuite/ld-powerpc/group1.sym 2021-07-20 16:24:17.384868997 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/group1.sym 2021-07-20 16:27:36.604757678 +0100 +@@ -1,2 +1 @@ +-#... + #pass +--- binutils.orig/ld/testsuite/ld-powerpc/group3.sym 2021-07-20 16:24:17.389868970 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/group3.sym 2021-07-20 16:28:33.372441000 +0100 +@@ -1,2 +1 @@ +-#... + #pass +--- binutils.orig/ld/testsuite/ld-powerpc/pr23937.d 2021-07-20 16:24:17.386868986 +0100 ++++ binutils-2.37/ld/testsuite/ld-powerpc/pr23937.d 2021-07-20 16:29:00.604289085 +0100 +@@ -5,5 +5,4 @@ -+setup_xfail i686*-*-* -+ - if [string match "" $exec_output] then { - pass $test6 - } else { -@@ -199,6 +203,8 @@ set exec_output [prune_warnings $exec_ou + #... + .* R_PPC64_IRELATIVE +10000180 +-#... + #pass +--- binutils.orig/ld/testsuite/ld-elf/pr26580-3.out 2021-07-20 17:07:36.952369125 +0100 ++++ binutils-2.37/ld/testsuite/ld-elf/pr26580-3.out 2021-07-20 17:13:39.069350355 +0100 +@@ -1,2 +1,2 @@ + library not loaded +-alignment 1 ++alignment . +--- binutils.orig/ld/testsuite/ld-elf/shared.exp 2021-07-20 17:07:36.950369136 +0100 ++++ binutils-2.37/ld/testsuite/ld-elf/shared.exp 2021-07-20 17:16:04.267540887 +0100 +@@ -1536,18 +1536,6 @@ if { [istarget *-*-linux*] + "pr22393-2-static" \ + "pass.out" \ + ] \ +- [list \ +- "Run pr21964-4" \ +- "" \ +- "" \ +- {pr21964-4.c} \ +- "pr21964-4" \ +- "pass.out" \ +- "" \ +- "" \ +- "" \ +- "-ldl" \ +- ] \ + ] + } - regsub -all "(^|\n)($ld: warning: cannot find entry symbol\[^\n\]*\n?)" $exec_output "\\1" exec_output +--- binutils.orig/ld/testsuite/ld-elf/tls.exp 2021-07-20 17:07:36.953369120 +0100 ++++ binutils-2.37/ld/testsuite/ld-elf/tls.exp 2021-07-20 17:20:40.443001211 +0100 +@@ -32,6 +32,9 @@ if { !([istarget *-*-linux*] + if { ![check_compiler_available] } { + return + } ++if { [istarget s390x*-*-*] } { ++ return ++} -+setup_xfail i686*-*-* -+ - if [string match "" $exec_output] then { - fail $test7 - } else { -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-shared/shared.exp binutils-2.37-new/ld/testsuite/ld-shared/shared.exp ---- binutils-2.37/ld/testsuite/ld-shared/shared.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-shared/shared.exp 2021-07-24 21:59:28.987706795 +0200 -@@ -36,9 +36,6 @@ if { ![istarget hppa*64*-*-hpux*] \ - && ![istarget hppa*-*-linux*] \ - && ![istarget i?86-*-sysv4*] \ - && ![istarget i?86-*-unixware] \ -- && ![istarget i?86-*-elf*] \ -- && ![istarget i?86-*-linux*] \ -- && ![istarget i?86-*-gnu*] \ - && ![istarget *-*-nacl*] \ - && ![istarget ia64-*-elf*] \ - && ![istarget ia64-*-linux*] \ -diff -rupN --no-dereference binutils-2.37/ld/testsuite/ld-x86-64/x86-64.exp binutils-2.37-new/ld/testsuite/ld-x86-64/x86-64.exp ---- binutils-2.37/ld/testsuite/ld-x86-64/x86-64.exp 2021-07-08 13:37:20.000000000 +0200 -+++ binutils-2.37-new/ld/testsuite/ld-x86-64/x86-64.exp 2021-07-24 21:59:28.987706795 +0200 -@@ -1466,22 +1466,6 @@ if { [isnative] && [check_compiler_avail + # This target requires extra GAS options when building PIC/PIE code. + set AFLAGS_PIC "" +--- binutils.orig/binutils/testsuite/binutils-all/compress.exp 2021-08-18 12:41:47.036991908 +0100 ++++ binutils-2.37/binutils/testsuite/binutils-all/compress.exp 2021-08-18 12:47:46.097987950 +0100 +@@ -766,12 +766,6 @@ proc test_gnu_debuglink {} { } else { - run_cc_link_tests [list \ - [list \ -- "Build pr22001-1b" \ -- "$NOPIE_LDFLAGS -Wl,-z,nocopyreloc,--no-as-needed,-z,notext tmpdir/pr22001-1.so" \ -- "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ -- { pr22001-1c.c } \ -- {{error_output "pr22001-1b.err"}} \ -- "pr22001-1b" \ -- ] \ -- [list \ -- "Build pr21997-1b" \ -- "$NOPIE_LDFLAGS -Wl,--no-as-needed,-z,notext tmpdir/pr21997-1.so" \ -- "$NOPIE_CFLAGS -Wa,-mx86-used-note=yes" \ -- { pr21997-1c.c } \ -- {{error_output "pr21997-1b.err"}} \ -- "pr21997-1b" \ -- ] \ -- [list \ - "Build lam-u48.so" \ - "-shared -Wl,-z,lam-u48" \ - "" \ -@@ -1813,49 +1797,6 @@ if { [isnative] && [check_compiler_avail - if { [istarget "x86_64-*-linux*"] \ - && ![istarget "x86_64-*-linux*-gnux32"]} { - -- run_cc_link_tests [list \ -- [list \ -- "Build plt-main with -z bndplt" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \ -- { plt-main5.c } \ -- {{objdump {-drw} plt-main-bnd.dd}} \ -- "plt-main-bnd" \ -- ] \ -- [list \ -- "Build plt-main with PIE and -z bndplt" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt -pie \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-fPIC -Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \ -- { plt-main5.c } \ -- {{objdump {-drw} plt-main-bnd.dd}} \ -- "plt-main-pie-bnd" \ -- ] \ -- [list \ -- "Build plt-main with -z bndplt -z now" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt -z now \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \ -- { plt-main5.c } \ -- {{readelf {-SW} plt-main-bnd-now.rd} {objdump {-drw} plt-main-bnd.dd}} \ -- "plt-main-bnd-now" \ -- ] \ -- [list \ -- "Build plt-main with PIE and -z bndplt -z now" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z bndplt -z now -pie \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-fPIC -Wa,-mx86-used-note=yes $NOCF_PROTECTION_CFLAGS" \ -- { plt-main5.c } \ -- {{readelf {-SW} plt-main-bnd-now.rd} {objdump {-drw} plt-main-bnd.dd}} \ -- "plt-main-pie-bnd-now" \ -- ] \ -- ] -- - run_ld_link_exec_tests [list \ - [list \ - "Run plt-main with -z bndplt" \ -@@ -1940,66 +1881,6 @@ if { [isnative] && [check_compiler_avail - set pltdump {{objdump {-drw} plt-main-ibt.dd}} - set pltsecdump {{readelf {-SW} plt-main-ibt-now.rd} {objdump {-drw} plt-main-ibt.dd}} - } -- run_cc_link_tests [list \ -- [list \ -- "Build plt-main with -z ibtplt" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z ibtplt \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-Wa,-mx86-used-note=yes" \ -- { plt-main5.c } \ -- $pltdump \ -- "plt-main-ibt" \ -- ] \ -- [list \ -- "Build plt-main with PIE and -z ibtplt" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z ibtplt -pie \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-fPIC -Wa,-mx86-used-note=yes" \ -- { plt-main5.c } \ -- $pltdump \ -- "plt-main-pie-ibt" \ -- ] \ -- [list \ -- "Build plt-main with -z ibtplt -z now" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z ibtplt -z now \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-Wa,-mx86-used-note=yes" \ -- { plt-main5.c } \ -- $pltsecdump \ -- "plt-main-ibt-now" \ -- ] \ -- [list \ -- "Build plt-main with PIE and -z ibtplt -z now" \ -- "tmpdir/plt-main1.o tmpdir/plt-main2.o tmpdir/plt-main3.o \ -- tmpdir/plt-main4.o tmpdir/libplt-lib.so -z ibtplt -z now -pie \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-fPIC -Wa,-mx86-used-note=yes" \ -- { plt-main5.c } \ -- $pltsecdump \ -- "plt-main-pie-ibt-now" \ -- ] \ -- [list \ -- "Build libibtplt-lib.so with -z ibtplt" \ -- "-shared -z ibtplt \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-fPIC -Wa,-mx86-used-note=yes" \ -- { plt-main1.c plt-main2.c plt-main3.c plt-main4.c} \ -- $pltdump \ -- "libibtplt-lib.so" \ -- ] \ -- [list \ -- "Build libibtplt--now-lib.so with -z ibtplt -z now" \ -- "-shared -z ibtplt -z now \ -- -z noseparate-code -z max-page-size=0x200000" \ -- "-fPIC -Wa,-mx86-used-note=yes" \ -- { plt-main1.c plt-main2.c plt-main3.c plt-main4.c} \ -- $pltdump \ -- "libibtplt-now-lib.so" \ -- ] \ -- ] - - run_ld_link_exec_tests [list \ - [list \ -@@ -2044,24 +1925,6 @@ if { [isnative] && [check_compiler_avail - "plt-main.out" \ - "-fPIC" \ - ] \ -- [list \ -- "Run plt-main with libibtplt-lib.so -z ibtplt" \ -- "-Wl,--no-as-needed,-z,ibtplt tmpdir/libibtplt-lib.so \ -- tmpdir/libplt-lib.so" \ -- "-Wa,-mx86-used-note=yes" \ -- { plt-main5.c } \ -- "plt-main-ibt-lib" \ -- "plt-main.out" \ -- ] \ -- [list \ -- "Run plt-main with libibtplt-lib.so -z ibtplt -z now" \ -- "-Wl,--no-as-needed,-z,ibtplt,-z,now \ -- tmpdir/libibtplt-now-lib.so tmpdir/libplt-lib.so" \ -- "-Wa,-mx86-used-note=yes" \ -- { plt-main5.c } \ -- "plt-main-ibt-now-lib" \ -- "plt-main.out" \ -- ] \ - ] - - if { [check_ifunc_attribute_available] } { -@@ -2088,7 +1951,6 @@ if { [isnative] && [check_compiler_avail - } + pass "$test (objdump with missing link)" } +- set got [remote_exec host [concat sh -c [list "$READELF -S tmpdir/testprog > /dev/null"]]] +- if { [lindex $got 0] != 0 || ![string match "" [lindex $got 1]] } then { +- fail "$test (readelf with missing link)" +- } else { +- pass "$test (readelf with missing link)" +- } + } -- undefined_weak "$NOPIE_CFLAGS" "$NOPIE_LDFLAGS" - undefined_weak "-fPIE" "" - undefined_weak "-fPIE" "-pie" - undefined_weak "-fPIE" "-Wl,-z,nodynamic-undefined-weak" + if {[is_elf_format]} then { diff --git a/binutils-use-long-long.patch b/binutils-use-long-long.patch index 8ac8f85..1ea7418 100644 --- a/binutils-use-long-long.patch +++ b/binutils-use-long-long.patch @@ -1,7 +1,7 @@ -diff -rupN --no-dereference binutils-2.37/bfd/configure binutils-2.37-new/bfd/configure ---- binutils-2.37/bfd/configure 2021-07-18 18:36:53.000000000 +0200 -+++ binutils-2.37-new/bfd/configure 2021-07-24 21:59:26.907727053 +0200 -@@ -12751,11 +12751,13 @@ if test "x${ac_cv_sizeof_long}" = "x8"; +diff -up binutils-2.25.orig/bfd/configure.ac binutils-2.25/bfd/configure.ac +--- binutils-2.25.orig/bfd/configure.ac 2014-12-24 10:34:45.590491143 +0000 ++++ binutils-2.25/bfd/configure.ac 2014-12-24 10:36:12.997981992 +0000 +@@ -183,11 +183,13 @@ if test "x${ac_cv_sizeof_long}" = "x8"; BFD_HOST_64BIT_LONG=1 test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" @@ -17,10 +17,10 @@ diff -rupN --no-dereference binutils-2.37/bfd/configure binutils-2.37-new/bfd/co BFD_HOSTPTR_T="unsigned long long" fi fi -diff -rupN --no-dereference binutils-2.37/bfd/configure.ac binutils-2.37-new/bfd/configure.ac ---- binutils-2.37/bfd/configure.ac 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/configure.ac 2021-07-24 21:59:26.908727043 +0200 -@@ -230,11 +230,13 @@ if test "x${ac_cv_sizeof_long}" = "x8"; +diff -up ../binutils-2.20.51.0.7.original/bfd/configure ./bfd/configure +--- a/bfd/configure 2010-04-08 15:23:58.000000000 +0100 ++++ b/bfd/configure 2010-04-08 15:24:06.000000000 +0100 +@@ -12819,11 +12819,13 @@ BFD_HOST_64BIT_LONG=1 test -n "${HOST_64BIT_TYPE}" || HOST_64BIT_TYPE="long" test -n "${HOST_U_64BIT_TYPE}" || HOST_U_64BIT_TYPE="unsigned long" diff --git a/binutils-version.patch b/binutils-version.patch index 5438e58..2552ee3 100644 --- a/binutils-version.patch +++ b/binutils-version.patch @@ -1,10 +1,10 @@ -diff -rupN --no-dereference binutils-2.37/bfd/Makefile.am binutils-2.37-new/bfd/Makefile.am ---- binutils-2.37/bfd/Makefile.am 2021-07-08 13:37:19.000000000 +0200 -+++ binutils-2.37-new/bfd/Makefile.am 2021-07-24 21:59:00.067988456 +0200 -@@ -942,8 +942,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD +diff -rup binutils.orig/bfd/Makefile.am binutils-2.38/bfd/Makefile.am +--- binutils.orig/bfd/Makefile.am 2022-02-09 14:10:42.659300681 +0000 ++++ binutils-2.38/bfd/Makefile.am 2022-02-09 14:12:40.562532916 +0000 +@@ -977,8 +977,8 @@ DISTCLEANFILES = $(BUILD_CFILES) $(BUILD bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in - @echo "creating $@" - @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ + $(AM_V_GEN)\ + bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ - bfd_version_string="\"$(VERSION)\"" ;\ - bfd_soversion="$(VERSION)" ;\ + bfd_version_string="\"$(VERSION)-%{release}\"" ;\ @@ -12,7 +12,7 @@ diff -rupN --no-dereference binutils-2.37/bfd/Makefile.am binutils-2.37-new/bfd/ bfd_version_package="\"$(PKGVERSION)\"" ;\ report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ . $(srcdir)/development.sh ;\ -@@ -954,7 +954,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ +@@ -989,7 +989,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ fi ;\ $(SED) -e "s,@bfd_version@,$$bfd_version," \ -e "s,@bfd_version_string@,$$bfd_version_string," \ @@ -21,13 +21,13 @@ diff -rupN --no-dereference binutils-2.37/bfd/Makefile.am binutils-2.37-new/bfd/ -e "s,@report_bugs_to@,$$report_bugs_to," \ < $(srcdir)/version.h > $@; \ echo "$${bfd_soversion}" > libtool-soversion -diff -rupN --no-dereference binutils-2.37/bfd/Makefile.in binutils-2.37-new/bfd/Makefile.in ---- binutils-2.37/bfd/Makefile.in 2021-07-18 18:36:53.000000000 +0200 -+++ binutils-2.37-new/bfd/Makefile.in 2021-07-24 21:59:00.069988437 +0200 -@@ -2053,8 +2053,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) +diff -rup binutils.orig/bfd/Makefile.in binutils-2.38/bfd/Makefile.in +--- binutils.orig/bfd/Makefile.in 2022-02-09 14:10:42.653300720 +0000 ++++ binutils-2.38/bfd/Makefile.in 2022-02-09 14:19:03.362040188 +0000 +@@ -2094,8 +2094,8 @@ stmp-lcoff-h: $(LIBCOFF_H_FILES) $(MKDOC bfdver.h: $(srcdir)/version.h $(srcdir)/development.sh $(srcdir)/Makefile.in - @echo "creating $@" - @bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ + $(AM_V_GEN)\ + bfd_version=`echo "$(VERSION)" | $(SED) -e 's/\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\)\.*\([^\.]*\).*/\1.00\2.00\3.00\4.00\5/' -e 's/\([^\.]*\)\..*\(..\)\..*\(..\)\..*\(..\)\..*\(..\)$$/\1\2\3\4\5/'` ;\ - bfd_version_string="\"$(VERSION)\"" ;\ - bfd_soversion="$(VERSION)" ;\ + bfd_version_string="\"$(VERSION)-%{release}\"" ;\ @@ -35,7 +35,7 @@ diff -rupN --no-dereference binutils-2.37/bfd/Makefile.in binutils-2.37-new/bfd/ bfd_version_package="\"$(PKGVERSION)\"" ;\ report_bugs_to="\"$(REPORT_BUGS_TO)\"" ;\ . $(srcdir)/development.sh ;\ -@@ -2065,7 +2065,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ +@@ -2106,7 +2106,7 @@ bfdver.h: $(srcdir)/version.h $(srcdir)/ fi ;\ $(SED) -e "s,@bfd_version@,$$bfd_version," \ -e "s,@bfd_version_string@,$$bfd_version_string," \ diff --git a/gcc12-libtool-no-rpath.patch b/gcc12-libtool-no-rpath.patch new file mode 100644 index 0000000..a4f90a1 --- /dev/null +++ b/gcc12-libtool-no-rpath.patch @@ -0,0 +1,28 @@ +diff -rup binutils.orig/ltmain.sh binutils-2.37/ltmain.sh +--- binutils.orig/ltmain.sh 2022-01-27 16:23:09.304207432 +0000 ++++ binutils-2.37/ltmain.sh 2022-01-27 16:23:18.380143759 +0000 +@@ -7103,6 +7103,7 @@ EOF + rpath="$finalize_rpath" + test "$mode" != relink && rpath="$compile_rpath$rpath" + for libdir in $rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -7798,6 +7799,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $compile_rpath $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +@@ -7849,6 +7851,7 @@ EOF + rpath= + hardcode_libdirs= + for libdir in $finalize_rpath; do ++ case "$libdir" in /usr/lib|/usr/lib64|/usr/lib/../lib|/usr/lib/../lib64) continue;; esac + if test -n "$hardcode_libdir_flag_spec"; then + if test -n "$hardcode_libdir_separator"; then + if test -z "$hardcode_libdirs"; then +Only in binutils-2.37: ltmain.sh.orig diff --git a/mingw-binutils.spec b/mingw-binutils.spec index 8021943..7942fab 100644 --- a/mingw-binutils.spec +++ b/mingw-binutils.spec @@ -2,8 +2,8 @@ %global mingw_build_ucrt64 1 Name: mingw-binutils -Version: 2.37 -Release: 5%{?dist} +Version: 2.38 +Release: 1%{?dist} Summary: Cross-compiled version of binutils for Win32 and Win64 environments License: GPLv2+ and LGPLv2+ and GPLv3+ and LGPLv3+ @@ -72,28 +72,29 @@ Patch07: binutils-readelf-other-sym-info.patch # debug sections. # Lifetime: Permanent. # FIXME: Find related bug. Decide on permanency. -Patch08: binutils-2.27-aarch64-ifunc.patch +# Not needed, mingw does not have aarch64 +# Patch08: binutils-2.27-aarch64-ifunc.patch # Purpose: Stop the binutils from statically linking with libstdc++. # Lifetime: Permanent. Patch09: binutils-do-not-link-with-static-libstdc++.patch # Purpose: Allow OS specific sections in section groups. -# Lifetime: Fixed in 2.38 (maybe) +# Lifetime: Fixed in 2.39 (maybe) Patch10: binutils-special-sections-in-groups.patch # Purpose: Fix linker testsuite failures. -# Lifetime: Fixed in 2.37 (maybe) +# Lifetime: Fixed in 2.39 (maybe) Patch11: binutils-fix-testsuite-failures.patch # Purpose: Stop gold from aborting when input sections with the same name # have different flags. -# Lifetime: Fixed in 2.38 (maybe) +# Lifetime: Fixed in 2.39 (maybe) Patch12: binutils-gold-mismatched-section-flags.patch # Purpose: Add a check to the GOLD linker for a corrupt input file # with a fuzzed section offset. -# Lifetime: Fixed in 2.38 (maybe) +# Lifetime: Fixed in 2.39 (maybe) Patch13: binutils-CVE-2019-1010204.patch # Purpose: Change the gold configuration script to only warn about @@ -110,7 +111,6 @@ Patch14: binutils-gold-warn-unsupported.patch # Lifetime: Permanent. Patch15: binutils-use-long-long.patch - # Purpose: Fix testsuite failures due to the patches applied here. # Lifetime: Permanent, but varying with each new rebase. Patch16: binutils-testsuite-fixes.patch @@ -120,8 +120,26 @@ Patch16: binutils-testsuite-fixes.patch # Lifetime: Fixed in 2.38 maybe Patch17: binutils-gold-i386-gnu-property-notes.patch -# Backport patch for CVE-2021-45078 -Patch18: CVE-2021-45078.patch +# Purpose: Allow the binutils to be configured with any (recent) version of +# autoconf. +# Lifetime: Fixed in 2.39 (maybe ?) +Patch18: binutils-autoconf-version.patch + +# Purpose: Stop libtool from inserting useless runpaths into binaries. +# Lifetime: Who knows. +Patch19: gcc12-libtool-no-rpath.patch + +# Purpose: Add support for specifying section types in linker scripts. +# Lifetime: Fixed in 2.39 +Patch20: binutils-section-type.patch + +# Purpose: Simplify the evaluation of assembler loc view expression chains. +# Lifetime: Fixed in 2.39 +Patch21: binutils-gas-loc-view.patch + +# Purpose: Add an option to disable access to debuginfod servers. +# Lifetime: Fixed in 2.39 +Patch22: binutils-do-not-use-debuginfod.patch BuildRequires: make @@ -455,6 +473,9 @@ rm -rf %{buildroot}%{_mandir}/man1/* %changelog +* Fri Mar 11 2022 Sandro Mani - 2.38-1 +- Update to 2.38 + * Wed Feb 23 2022 Marc-André Lureau - 2.37-5 - Add ucrt64 target. Related to rhbz#2055254. diff --git a/sources b/sources index b8c6109..9b6309a 100644 --- a/sources +++ b/sources @@ -1 +1 @@ -SHA512 (binutils-2.37.tar.xz) = 5c11aeef6935860a6819ed3a3c93371f052e52b4bdc5033da36037c1544d013b7f12cb8d561ec954fe7469a68f1b66f1a3cd53d5a3af7293635a90d69edd15e7 +SHA512 (binutils-2.38.tar.xz) = 8bf0b0d193c9c010e0518ee2b2e5a830898af206510992483b427477ed178396cd210235e85fd7bd99a96fc6d5eedbeccbd48317a10f752b7336ada8b2bb826d