Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package binutils for openSUSE:Factory checked in at 2021-09-17 23:25:22 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/binutils (Old) and /work/SRC/openSUSE:Factory/.binutils.new.1899 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "binutils" Fri Sep 17 23:25:22 2021 rev:150 rq:910009 version:2.37 Changes: -------- --- /work/SRC/openSUSE:Factory/binutils/binutils.changes 2021-05-17 18:44:51.752738709 +0200 +++ /work/SRC/openSUSE:Factory/.binutils.new.1899/binutils.changes 2021-09-17 23:25:29.989212010 +0200 @@ -1,0 +2,86 @@ +Tue Aug 3 13:36:19 UTC 2021 - Martin Li??ka <[email protected]> + +- Bump binutils-2.37-branch.diff: fixes PR28138. + +------------------------------------------------------------------- +Thu Jul 22 17:36:14 UTC 2021 - Martin Li??ka <[email protected]> + +- Use LTO & PGO build. + +------------------------------------------------------------------- +Thu Jul 22 15:01:27 UTC 2021 - Martin Li??ka <[email protected]> + +- Update to binutils 2.37: + * The GNU Binutils sources now requires a C99 compiler and library to + build. + * Support for the arm-symbianelf format has been removed. + * Support for Realm Management Extension (RME) for AArch64 has been + added. + * A new linker option '-z report-relative-reloc' for x86 ELF targets + has been added to report dynamic relative relocations. + * A new linker option '-z start-stop-gc' has been added to disable + special treatment of __start_*/__stop_* references when + --gc-sections. + * A new linker options '-Bno-symbolic' has been added which will + cancel the '-Bsymbolic' and '-Bsymbolic-functions' options. + * The readelf tool has a new command line option which can be used to + specify how the numeric values of symbols are reported. + --sym-base=0|8|10|16 tells readelf to display the values in base 8, + base 10 or base 16. A sym base of 0 represents the default action + of displaying values under 10000 in base 10 and values above that in + base 16. + * A new format has been added to the nm program. Specifying + '--format=just-symbols' (or just using -j) will tell the program to + only display symbol names and nothing else. + * A new command line option '--keep-section-symbols' has been added to + objcopy and strip. This stops the removal of unused section symbols + when the file is copied. Removing these symbols saves space, but + sometimes they are needed by other tools. + * The '--weaken', '--weaken-symbol' and '--weaken-symbols' options + supported by objcopy now make undefined symbols weak on targets that + support weak symbols. + * Readelf and objdump can now display and use the contents of .debug_sup + sections. + * Readelf and objdump will now follow links to separate debug info + files by default. This behaviour can be stopped via the use of the + new '-wN' or '--debug-dump=no-follow-links' options for readelf and + the '-WN' or '--dwarf=no-follow-links' options for objdump. Also + the old behaviour can be restored by the use of the + '--enable-follow-debug-links=no' configure time option. + + The semantics of the =follow-links option have also been slightly + changed. When enabled, the option allows for the loading of symbol + tables and string tables from the separate files which can be used + to enhance the information displayed when dumping other sections, + but it does not automatically imply that information from the + separate files should be displayed. + + If other debug section display options are also enabled (eg + '--debug-dump=info') then the contents of matching sections in both + the main file and the separate debuginfo file *will* be displayed. + This is because in most cases the debug section will only be present + in one of the files. + + If however non-debug section display options are enabled (eg + '--sections') then the contents of matching parts of the separate + debuginfo file will *not* be displayed. This is because in most + cases the user probably only wanted to load the symbol information + from the separate debuginfo file. In order to change this behaviour + a new command line option --process-links can be used. This will + allow di0pslay options to applied to both the main file and any + separate debuginfo files. + * Nm has a new command line option: '--quiet'. This suppresses "no + symbols" diagnostic. +- Includes fixes for these CVEs: + bnc#1181452 aka CVE-2021-20197 aka PR26945 + bnc#1183511 aka CVE-2021-20284 aka PR26931 + bnc#1184620 aka CVE-2021-3487 aka PR26946 + bnc#1184794 aka CVE-2020-35448 aka PR26574 +- Rebased patches: binutils-build-as-needed.diff, binutils-fix-abierrormsg.diff, + binutils-fix-invalid-op-errata.diff, binutils-fix-relax.diff, + binutils-revert-nm-symversion.diff, binutils-revert-plt32-in-branches.diff +- Removed patches (are in upstream): ppc-ensure-undef-dynamic-weak-undefined.patch and + ppc-use-local-plt.patch. +- Add binutils-2.37-branch.diff.gz. + +------------------------------------------------------------------- cross-aarch64-binutils.changes: same change cross-arm-binutils.changes: same change cross-avr-binutils.changes: same change cross-epiphany-binutils.changes: same change cross-hppa-binutils.changes: same change cross-hppa64-binutils.changes: same change cross-i386-binutils.changes: same change cross-ia64-binutils.changes: same change cross-m68k-binutils.changes: same change cross-mips-binutils.changes: same change cross-ppc-binutils.changes: same change cross-ppc64-binutils.changes: same change cross-ppc64le-binutils.changes: same change cross-riscv64-binutils.changes: same change cross-rx-binutils.changes: same change cross-s390-binutils.changes: same change cross-s390x-binutils.changes: same change cross-sparc-binutils.changes: same change cross-sparc64-binutils.changes: same change cross-spu-binutils.changes: same change cross-x86_64-binutils.changes: same change cross-xtensa-binutils.changes: same change Old: ---- binutils-2.36-branch.diff.gz binutils-2.36.tar.bz2 binutils-2.36.tar.bz2.sig ppc-ensure-undef-dynamic-weak-undefined.patch ppc-use-local-plt.patch New: ---- binutils-2.37-branch.diff.gz binutils-2.37.tar.bz2 binutils-2.37.tar.bz2.sig ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ binutils.spec ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.245217588 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.245217588 +0200 @@ -34,7 +34,7 @@ %else BuildRequires: zlib-devel %endif -Version: 2.36 +Version: 2.37 Release: 0 # # RUN_TESTS @@ -83,7 +83,7 @@ Source1: pre_checkin.sh Source2: README.First-for.SUSE.packagers Source3: baselibs.conf -Patch1: binutils-2.36-branch.diff.gz +Patch1: binutils-2.37-branch.diff.gz Patch3: binutils-skip-rpaths.patch Patch4: s390-biarch.diff Patch5: x86-64-biarch.patch @@ -101,8 +101,6 @@ Patch39: binutils-revert-nm-symversion.diff Patch40: binutils-fix-abierrormsg.diff Patch41: binutils-fix-relax.diff -Patch42: ppc-use-local-plt.patch -Patch43: ppc-ensure-undef-dynamic-weak-undefined.patch Patch100: add-ulp-section.diff Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch @@ -194,8 +192,6 @@ %patch39 -p1 %patch40 -p1 %patch41 -p1 -%patch42 -p1 -%patch43 -p1 %patch100 -p1 %if "%{TARGET}" == "avr" cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h @@ -283,7 +279,11 @@ --enable-default-hash-style=both \ %endif --enable-shared \ +%if %{suse_version} > 1500 + --enable-pgo-build=lto \ +%endif --enable-obsolete + make %{?_smp_mflags} %else ++++++ cross-aarch64-binutils.spec ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.265217607 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.269217610 +0200 @@ -37,7 +37,7 @@ %else BuildRequires: zlib-devel %endif -Version: 2.36 +Version: 2.37 Release: 0 # # RUN_TESTS @@ -86,7 +86,7 @@ Source1: pre_checkin.sh Source2: README.First-for.SUSE.packagers Source3: baselibs.conf -Patch1: binutils-2.36-branch.diff.gz +Patch1: binutils-2.37-branch.diff.gz Patch3: binutils-skip-rpaths.patch Patch4: s390-biarch.diff Patch5: x86-64-biarch.patch @@ -104,8 +104,6 @@ Patch39: binutils-revert-nm-symversion.diff Patch40: binutils-fix-abierrormsg.diff Patch41: binutils-fix-relax.diff -Patch42: ppc-use-local-plt.patch -Patch43: ppc-ensure-undef-dynamic-weak-undefined.patch Patch100: add-ulp-section.diff Patch90: cross-avr-nesc-as.patch Patch92: cross-avr-omit_section_dynsym.patch @@ -197,8 +195,6 @@ %patch39 -p1 %patch40 -p1 %patch41 -p1 -%patch42 -p1 -%patch43 -p1 %patch100 -p1 %if "%{TARGET}" == "avr" cp gas/config/tc-avr.h gas/config/tc-avr-nesc.h @@ -286,7 +282,11 @@ --enable-default-hash-style=both \ %endif --enable-shared \ +%if %{suse_version} > 1500 + --enable-pgo-build=lto \ +%endif --enable-obsolete + make %{?_smp_mflags} %else cross-arm-binutils.spec: same change cross-avr-binutils.spec: same change cross-epiphany-binutils.spec: same change cross-hppa-binutils.spec: same change cross-hppa64-binutils.spec: same change cross-i386-binutils.spec: same change cross-ia64-binutils.spec: same change cross-m68k-binutils.spec: same change cross-mips-binutils.spec: same change cross-ppc-binutils.spec: same change cross-ppc64-binutils.spec: same change cross-ppc64le-binutils.spec: same change cross-riscv64-binutils.spec: same change cross-rx-binutils.spec: same change cross-s390-binutils.spec: same change cross-s390x-binutils.spec: same change cross-sparc-binutils.spec: same change cross-sparc64-binutils.spec: same change cross-spu-binutils.spec: same change cross-x86_64-binutils.spec: same change cross-xtensa-binutils.spec: same change ++++++ add-ulp-section.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.781218067 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.781218067 +0200 @@ -2,26 +2,26 @@ shared libs or executable (in the .ulp section) when one of the input files contains a section named .ulp.track. -Index: binutils-2.35/bfd/elf-bfd.h -=================================================================== ---- binutils-2.35.orig/bfd/elf-bfd.h 2020-07-24 11:12:19.000000000 +0200 -+++ binutils-2.35/bfd/elf-bfd.h 2020-08-10 16:30:46.555219071 +0200 -@@ -1476,6 +1476,10 @@ struct elf_backend_data +diff --git a/bfd/elf-bfd.h b/bfd/elf-bfd.h +index 101c2fdf50d..f5d9e201fdb 100644 +--- a/bfd/elf-bfd.h ++++ b/bfd/elf-bfd.h +@@ -1487,6 +1487,10 @@ struct elf_backend_data (const bfd *ibfd, bfd *obfd, const Elf_Internal_Shdr *isection, Elf_Internal_Shdr *osection); -+ bfd_boolean (*elf_backend_is_ulp_enabled) (bfd *abfd); ++ bool (*elf_backend_is_ulp_enabled) (bfd *abfd); + -+ bfd_boolean (*elf_backend_setup_ulp) (struct bfd_link_info *); ++ bool (*elf_backend_setup_ulp) (struct bfd_link_info *); + /* Used to handle bad SHF_LINK_ORDER input. */ void (*link_order_error_handler) (const char *, ...); -Index: binutils-2.35/bfd/elflink.c -=================================================================== ---- binutils-2.35.orig/bfd/elflink.c 2020-07-24 11:12:19.000000000 +0200 -+++ binutils-2.35/bfd/elflink.c 2020-08-10 16:30:46.565219071 +0200 -@@ -7197,6 +7197,13 @@ bfd_elf_size_dynamic_sections (bfd *outp +diff --git a/bfd/elflink.c b/bfd/elflink.c +index ce1407fa2dc..5c70bcf6c07 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -7260,6 +7260,13 @@ bfd_elf_size_dynamic_sections (bfd *output_bfd, s = bfd_get_linker_section (dynobj, ".gnu.version"); s->flags |= SEC_EXCLUDE; } @@ -33,13 +33,13 @@ + (*bed->elf_backend_setup_ulp)(info); + } } - return TRUE; + return true; } -Index: binutils-2.35/bfd/elfxx-target.h -=================================================================== ---- binutils-2.35.orig/bfd/elfxx-target.h 2020-07-24 11:12:19.000000000 +0200 -+++ binutils-2.35/bfd/elfxx-target.h 2020-08-10 16:30:46.565219071 +0200 -@@ -768,6 +768,14 @@ +diff --git a/bfd/elfxx-target.h b/bfd/elfxx-target.h +index 4c6b1f20340..1f54509cd08 100644 +--- a/bfd/elfxx-target.h ++++ b/bfd/elfxx-target.h +@@ -771,6 +771,14 @@ #define elf_backend_copy_special_section_fields _bfd_elf_copy_special_section_fields #endif @@ -54,7 +54,7 @@ #ifndef elf_backend_compact_eh_encoding #define elf_backend_compact_eh_encoding NULL #endif -@@ -900,6 +908,8 @@ static struct elf_backend_data elfNN_bed +@@ -904,6 +912,8 @@ static const struct elf_backend_data elfNN_bed = elf_backend_maybe_function_sym, elf_backend_get_reloc_section, elf_backend_copy_special_section_fields, @@ -63,40 +63,40 @@ elf_backend_link_order_error_handler, elf_backend_relplt_name, ELF_MACHINE_ALT1, -Index: binutils-2.35/bfd/elfxx-x86.c -=================================================================== ---- binutils-2.35.orig/bfd/elfxx-x86.c 2020-07-24 11:12:19.000000000 +0200 -+++ binutils-2.35/bfd/elfxx-x86.c 2020-08-10 16:30:46.565219071 +0200 +diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c +index 62d516aab8d..c0fb718d85c 100644 +--- a/bfd/elfxx-x86.c ++++ b/bfd/elfxx-x86.c @@ -31,6 +31,8 @@ #define ELF64_DYNAMIC_INTERPRETER "/lib/ld64.so.1" #define ELFX32_DYNAMIC_INTERPRETER "/lib/ldx32.so.1" +#define ULP_ENTRY_LEN 16 + - bfd_boolean + bool _bfd_x86_elf_mkobject (bfd *abfd) { -@@ -984,6 +986,64 @@ _bfd_elf_x86_valid_reloc_p (asection *in +@@ -984,6 +986,64 @@ _bfd_elf_x86_valid_reloc_p (asection *input_section, return valid_p; } +/* Check if input bfds are ulp-enabled by containing .ulp.track section */ + -+bfd_boolean ++bool +_bfd_x86_elf_is_ulp_enabled (struct bfd *input_bfd) +{ + while (input_bfd != NULL) + for (; input_bfd != NULL; input_bfd = input_bfd->link.next) + { + if (input_bfd->section_count == 0) continue; -+ if (bfd_get_section_by_name (input_bfd, ".ulp.track")) return TRUE; ++ if (bfd_get_section_by_name (input_bfd, ".ulp.track")) return true; + } -+ return FALSE; ++ return false; +} + +/* To be used by elf_link_hash_traverse when computing the ulp length */ + -+static bfd_boolean ++static bool +bfd_x86_elf_link_compute_ulp (struct elf_link_hash_entry *h, void *data) +{ + unsigned long *ulp_length = (unsigned long *) data; @@ -105,12 +105,12 @@ + { + ++(*ulp_length); + } -+ return TRUE; ++ return true; +} + +/* Fill the user-space live patching section */ + -+bfd_boolean ++bool +_bfd_x86_elf_setup_ulp (struct bfd_link_info *info) +{ + struct elf_x86_link_hash_table *htab; @@ -129,19 +129,19 @@ + + ulp->contents = (bfd_byte *) bfd_malloc (ulp->size); + if (ulp->contents == NULL) -+ return FALSE; ++ return false; + + if (!ulp->contents) -+ return FALSE; ++ return false; + + memset(ulp->contents, 0x00, ulp->size); -+ return TRUE; ++ return true; +} + /* Set the sizes of the dynamic sections. */ - bfd_boolean -@@ -2855,7 +2915,26 @@ _bfd_x86_elf_link_setup_gnu_properties + bool +@@ -3030,7 +3090,26 @@ _bfd_x86_elf_link_setup_gnu_properties htab->plt_second = sec; } @@ -169,11 +169,11 @@ if (!info->no_ld_generated_unwind_info) { -Index: binutils-2.35/bfd/elfxx-x86.h -=================================================================== ---- binutils-2.35.orig/bfd/elfxx-x86.h 2020-07-24 11:12:19.000000000 +0200 -+++ binutils-2.35/bfd/elfxx-x86.h 2020-08-10 16:30:46.565219071 +0200 -@@ -449,6 +449,7 @@ struct elf_x86_link_hash_table +diff --git a/bfd/elfxx-x86.h b/bfd/elfxx-x86.h +index db11327e96f..89f51382216 100644 +--- a/bfd/elfxx-x86.h ++++ b/bfd/elfxx-x86.h +@@ -452,6 +452,7 @@ struct elf_x86_link_hash_table asection *plt_second_eh_frame; asection *plt_got; asection *plt_got_eh_frame; @@ -181,20 +181,20 @@ /* Parameters describing PLT generation, lazy or non-lazy. */ struct elf_x86_plt_layout plt; -@@ -687,6 +688,12 @@ extern void _bfd_x86_elf_link_fixup_ifun - (struct bfd_link_info *, struct elf_x86_link_hash_table *, - struct elf_link_hash_entry *, Elf_Internal_Sym *sym); +@@ -690,6 +691,12 @@ extern void _bfd_x86_elf_link_report_relative_reloc + (struct bfd_link_info *, asection *, struct elf_link_hash_entry *, + Elf_Internal_Sym *, const char *, const void *); -+extern bfd_boolean _bfd_x86_elf_is_ulp_enabled ++extern bool _bfd_x86_elf_is_ulp_enabled + (struct bfd *); + -+extern bfd_boolean _bfd_x86_elf_setup_ulp ++extern bool _bfd_x86_elf_setup_ulp + (struct bfd_link_info *); + #define bfd_elf64_mkobject \ _bfd_x86_elf_mkobject #define bfd_elf32_mkobject \ -@@ -724,3 +731,7 @@ extern void _bfd_x86_elf_link_fixup_ifun +@@ -727,3 +734,7 @@ extern void _bfd_x86_elf_link_report_relative_reloc _bfd_x86_elf_merge_gnu_properties #define elf_backend_fixup_gnu_properties \ _bfd_x86_elf_link_fixup_gnu_properties ++++++ binutils-2.36-branch.diff.gz -> binutils-2.37-branch.diff.gz ++++++ Binary files /work/SRC/openSUSE:Factory/binutils/binutils-2.36-branch.diff.gz and /work/SRC/openSUSE:Factory/.binutils.new.1899/binutils-2.37-branch.diff.gz differ ++++++ binutils-2.36.tar.bz2 -> binutils-2.37.tar.bz2 ++++++ /work/SRC/openSUSE:Factory/binutils/binutils-2.36.tar.bz2 /work/SRC/openSUSE:Factory/.binutils.new.1899/binutils-2.37.tar.bz2 differ: char 12, line 1 ++++++ binutils-build-as-needed.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.833218113 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.837218116 +0200 @@ -2,12 +2,12 @@ =================================================================== --- ld/ldmain.c.orig 2017-07-26 10:07:31.862559913 +0200 +++ ld/ldmain.c 2017-07-26 10:07:31.886560303 +0200 -@@ -307,6 +307,8 @@ main (int argc, char **argv) +@@ -309,6 +309,8 @@ main (int argc, char **argv) yydebug = 1; } #endif + if (getenv ("SUSE_ASNEEDED") && atoi(getenv ("SUSE_ASNEEDED")) > 0) -+ input_flags.add_DT_NEEDED_for_regular = TRUE; ++ input_flags.add_DT_NEEDED_for_regular = true; - config.build_constructors = TRUE; + config.build_constructors = true; config.rpath_separator = ':'; ++++++ binutils-fix-abierrormsg.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.841218120 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.845218123 +0200 @@ -18,16 +18,15 @@ =================================================================== --- binutils-2.35.orig/bfd/elf64-ppc.c 2020-07-24 11:12:19.000000000 +0200 +++ binutils-2.35/bfd/elf64-ppc.c 2020-08-10 17:25:00.205219071 +0200 -@@ -5301,12 +5301,17 @@ ppc64_elf_merge_private_bfd_data (bfd *i - } - else if (iflags != oflags && iflags != 0) +@@ -5310,11 +5310,17 @@ ppc64_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info) + + if (iflags & ~EF_PPC64_ABI) { - _bfd_error_handler - /* xgettext:c-format */ -- (_("%pB: ABI version %ld is not compatible with ABI version %ld output"), -- ibfd, iflags, oflags); +- (_("%pB uses unknown e_flags 0x%lx"), ibfd, iflags); - bfd_set_error (bfd_error_bad_value); -- return FALSE; +- return false; + if (abiversion (info->output_bfd) == 0) + set_abiversion (info->output_bfd, abiversion (ibfd)); + else @@ -37,8 +36,8 @@ + (_("%pB: ABI version %ld is not compatible with ABI version %ld output"), + ibfd, iflags, oflags); + bfd_set_error (bfd_error_bad_value); -+ return FALSE; ++ return false; + } } - - if (!_bfd_elf_ppc_merge_fp_attributes (ibfd, info)) + else if (iflags != oflags && iflags != 0) + { ++++++ binutils-fix-invalid-op-errata.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.849218127 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.853218131 +0200 @@ -13,7 +13,7 @@ --- bfd/elfnn-aarch64.c.mm 2019-09-09 13:19:43.000000000 +0000 +++ bfd/elfnn-aarch64.c 2019-11-20 11:44:00.000000000 +0000 -@@ -4313,7 +4313,8 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, +@@ -4312,7 +4312,8 @@ elfNN_aarch64_size_stubs (bfd *output_bfd, || (input_bfd->flags & BFD_LINKER_CREATED) != 0) continue; @@ -21,5 +21,5 @@ + if (input_bfd != stub_bfd + && !_bfd_aarch64_erratum_835769_scan (input_bfd, info, &num_erratum_835769_fixes)) - return FALSE; + return false; } ++++++ binutils-fix-relax.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.861218138 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.861218138 +0200 @@ -15,6 +15,6 @@ { - if (abs_symbol && local_ref && relocx) + if (abs_symbol && local_ref && relocx && rex) - to_reloc_pc32 = FALSE; + to_reloc_pc32 = false; if (to_reloc_pc32) ++++++ binutils-revert-nm-symversion.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.869218145 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.869218145 +0200 @@ -4,29 +4,29 @@ those packages are fixed we use this patch. We have to carry it for old code streams forever. -Index: binutils-2.35/binutils/nm.c -=================================================================== ---- binutils-2.35.orig/binutils/nm.c 2020-07-24 11:12:19.000000000 +0200 -+++ binutils-2.35/binutils/nm.c 2020-08-07 16:42:58.000000000 +0200 -@@ -418,7 +418,7 @@ print_symname (const char *form, struct extended_symbol_info *info, +diff --git a/binutils/nm.c b/binutils/nm.c +index 2637756c647..253714ef179 100644 +--- a/binutils/nm.c ++++ b/binutils/nm.c +@@ -458,7 +458,7 @@ print_symname (const char *form, struct extended_symbol_info *info, name = alloc; } -- if (info != NULL && info->elfinfo) -+ if (info != NULL && info->elfinfo && 0) +- if (info != NULL && info->elfinfo && with_symbol_versions) ++ if (info != NULL && info->elfinfo && with_symbol_versions && 0) { const char *version_string; - bfd_boolean hidden; -Index: binutils-2.35/ld/testsuite/ld-elf/pr25708.d -=================================================================== ---- binutils-2.35.orig/ld/testsuite/ld-elf/pr25708.d 2020-07-24 11:12:20.000000000 +0200 -+++ binutils-2.35/ld/testsuite/ld-elf/pr25708.d 2020-08-07 16:44:50.000000000 +0200 + bool hidden; +diff --git a/ld/testsuite/ld-elf/pr25708.d b/ld/testsuite/ld-elf/pr25708.d +index 60b8e31807a..1b62e25347e 100644 +--- a/ld/testsuite/ld-elf/pr25708.d ++++ b/ld/testsuite/ld-elf/pr25708.d @@ -2,8 +2,9 @@ #ld: -shared -version-script pr13195.t - #nm: -D + #nm: -D --with-symbol-versions #target: *-*-linux* *-*-gnu* arm*-*-uclinuxfdpiceabi -#xfail: hppa64-*-* ![check_shared_lib_support] -+#xfail: *-*-* ![check_shared_lib_support] ++#xfail: *-*-* ![check_shared_lib_support] # h8300 doesn't support -shared, and hppa64 creates .foo +# our binutils revert the printing of symversions with nm -D ++++++ binutils-revert-plt32-in-branches.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.877218152 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.877218152 +0200 @@ -80,17 +80,17 @@ * testsuite/ld-x86-64/x86-64.exp: Run PR ld/22791 tests. diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c -index daae52b9537..5030cc6e121 100644 +index dc416a7f..b9f96729 100644 --- a/bfd/elf64-x86-64.c +++ b/bfd/elf64-x86-64.c -@@ -1834,6 +1834,24 @@ elf_x86_64_convert_load_reloc (bfd *abfd, - return TRUE; +@@ -1832,6 +1832,24 @@ elf_x86_64_convert_load_reloc (bfd *abfd, + return true; } +/* Is the instruction before OFFSET in CONTENTS a 32bit relative + branch? */ + -+static bfd_boolean ++static bool +is_32bit_relative_branch (bfd_byte *contents, bfd_vma offset) +{ + /* Opcode Instruction @@ -108,7 +108,7 @@ /* Look through the relocs for a section during the first phase, and calculate needed space in the global offset table, procedure linkage table, and dynamic reloc sections. */ -@@ -3143,28 +3161,30 @@ elf_x86_64_relocate_section (bfd *output_bfd, +@@ -3159,9 +3177,6 @@ elf_x86_64_relocate_section (bfd *output_bfd, && (eh == NULL || !UNDEFINED_WEAK_RESOLVED_TO_ZERO (info, eh))) @@ -118,10 +118,11 @@ || (no_copyreloc_p && h->def_dynamic && !(h->root.u.def.section->flags & SEC_CODE)))) +@@ -3170,20 +3185,25 @@ elf_x86_64_relocate_section (bfd *output_bfd, || bfd_link_dll (info))) { - bfd_boolean fail = FALSE; -+ bfd_boolean branch + bool fail = false; ++ bool branch + = ((r_type == R_X86_64_PC32 + || r_type == R_X86_64_PC32_BND) + && is_32bit_relative_branch (contents, rel->r_offset)); @@ -139,14 +140,15 @@ /* We can only use PC-relative relocations in PIE - from non-code sections. */ + from non-code sections or branches. */ - if (h->type == STT_FUNC - && (sec->flags & SEC_CODE) != 0) -- fail = TRUE; + if (h->root.type == bfd_link_hash_undefweak + || (h->type == STT_FUNC + && (sec->flags & SEC_CODE) != 0)) +- fail = true; + fail = !branch; } else if (no_copyreloc_p || bfd_link_dll (info)) { -@@ -3173,9 +3193,10 @@ elf_x86_64_relocate_section (bfd *output_bfd, +@@ -3192,9 +3212,10 @@ elf_x86_64_relocate_section (bfd *output_bfd, relocations against default and protected symbols since address of protected function and location of protected data may not be in @@ -160,10 +162,10 @@ if (fail) diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c -index 9a2dfc92281..885ee85b999 100644 +index d3441988e34..8f8fb086cd8 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c -@@ -8605,52 +8605,12 @@ output_branch (void) +@@ -8793,55 +8793,12 @@ output_branch (void) frag_var (rs_machine_dependent, 5, i.reloc[0], subtype, sym, off, p); } @@ -171,38 +173,41 @@ -/* Return TRUE iff PLT32 relocation should be used for branching to - symbol S. */ - --static bfd_boolean +-static bool -need_plt32_p (symbolS *s) -{ - /* PLT32 relocation is ELF only. */ - if (!IS_ELF) -- return FALSE; +- return false; - -#ifdef TE_SOLARIS - /* Don't emit PLT32 relocation on Solaris: neither native linker nor - krtld support it. */ -- return FALSE; +- return false; -#endif - - /* Since there is no need to prepare for PLT branch on x86-64, we - can generate R_X86_64_PLT32, instead of R_X86_64_PC32, which can - be used as a marker for 32-bit PC-relative branches. */ - if (!object_64bit) -- return FALSE; +- return false; +- +- if (s == NULL) +- return false; - - /* Weak or undefined symbol need PLT32 relocation. */ - if (S_IS_WEAK (s) || !S_IS_DEFINED (s)) -- return TRUE; +- return true; - - /* Non-global symbol doesn't need PLT32 relocation. */ - if (! S_IS_EXTERNAL (s)) -- return FALSE; +- return false; - - /* Other global symbols need PLT32 relocation. NB: Symbol with - non-default visibilities are treated as normal global symbol - so that PLT32 relocation can be used as a marker for 32-bit - PC-relative branches. It is useful for linker relaxation. */ -- return TRUE; +- return true; -} -#endif - @@ -216,7 +221,7 @@ if (i.tm.opcode_modifier.jump == JUMP_BYTE) { -@@ -8724,17 +8684,8 @@ output_jump (void) +@@ -8915,17 +8872,8 @@ output_jump (void) abort (); } @@ -233,9 +238,9 @@ - i.op[0].disps, 1, jump_reloc); + i.op[0].disps, 1, reloc (size, 1, 1, i.reloc[0])); - /* All jumps handled here are signed, but don't use a signed limit - check for 32 and 16 bit jumps as we want to allow wrap around at -@@ -12085,10 +12036,6 @@ md_estimate_size_before_relax (fragS *fragP, segT segment) + /* All jumps handled here are signed, but don't unconditionally use a + signed limit check for 32 and 16 bit jumps as we want to allow wrap +@@ -12184,10 +12132,6 @@ md_estimate_size_before_relax (fragS *fragP, segT segment) reloc_type = (enum bfd_reloc_code_real) fragP->fr_var; else if (size == 2) reloc_type = BFD_RELOC_16_PCREL; @@ -531,10 +536,10 @@ popq %rcx retq diff --git a/ld/testsuite/ld-x86-64/x86-64.exp b/ld/testsuite/ld-x86-64/x86-64.exp -index 83fdaa7db65..a3bb1e9ebd6 100644 +index 17fd10ee121..b4ae52ab376 100644 --- a/ld/testsuite/ld-x86-64/x86-64.exp +++ b/ld/testsuite/ld-x86-64/x86-64.exp -@@ -1250,44 +1250,6 @@ if { [isnative] && [check_compiler_available] } { +@@ -1264,44 +1264,6 @@ if { [isnative] && [check_compiler_available] } { {readelf -lW pr22393-3b.rd}} \ "pr22393-3-static" \ ] \ @@ -579,7 +584,7 @@ [list \ "Build pr22842.so" \ "-shared" \ -@@ -1752,15 +1714,6 @@ if { [isnative] && [check_compiler_available] } { +@@ -1703,15 +1665,6 @@ if { [isnative] && [check_compiler_available] } { "pr22393-3-static" \ "pass.out" \ ] \ ++++++ s390-pic-dso.diff ++++++ --- /var/tmp/diff_new_pack.QrbPp8/_old 2021-09-17 23:25:36.953218220 +0200 +++ /var/tmp/diff_new_pack.QrbPp8/_new 2021-09-17 23:25:36.953218220 +0200 @@ -24,7 +24,7 @@ + input_bfd, elf_howto_table[r_type].name, + h->root.root.string); + bfd_set_error (bfd_error_bad_value); -+ return FALSE; ++ return false; + } + if (h != NULL
