diff --git a/SOURCES/binutils-keep-weak-aliases.patch b/SOURCES/binutils-keep-weak-aliases.patch new file mode 100644 index 0000000..88346d1 --- /dev/null +++ b/SOURCES/binutils-keep-weak-aliases.patch @@ -0,0 +1,33 @@ +--- binutils.orig/bfd/elflink.c 2020-02-18 17:32:29.506802884 +0000 ++++ binutils-2.32/bfd/elflink.c 2020-02-18 17:34:09.783017828 +0000 +@@ -12988,6 +12988,7 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_i + { + unsigned long r_symndx; + struct elf_link_hash_entry *h; ++ struct elf_link_hash_entry *hw; + + r_symndx = cookie->rel->r_info >> cookie->r_sym_shift; + if (r_symndx == STN_UNDEF) +@@ -13007,12 +13008,16 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_i + || h->root.type == bfd_link_hash_warning) + h = (struct elf_link_hash_entry *) h->root.u.i.link; + h->mark = 1; +- /* If this symbol is weak and there is a non-weak definition, we +- keep the non-weak definition because many backends put +- dynamic reloc info on the non-weak definition for code +- handling copy relocs. */ +- if (h->is_weakalias) +- weakdef (h)->mark = 1; ++ /* Keep all aliases of the symbol too. If an object symbol ++ needs to be copied into .dynbss then all of its aliases ++ should be present as dynamic symbols, not just the one used ++ on the copy relocation. */ ++ hw = h; ++ while (hw->is_weakalias) ++ { ++ hw = hw->u.alias; ++ hw->mark = 1; ++ } + + if (start_stop != NULL) + { diff --git a/SPECS/binutils.spec b/SPECS/binutils.spec index 7431acf..6fd8915 100644 --- a/SPECS/binutils.spec +++ b/SPECS/binutils.spec @@ -4,7 +4,7 @@ Summary: A GNU collection of binary utilities Name: %{?scl_prefix}%{?cross}binutils%{?_with_debug:-debug} Version: 2.32 -Release: 14%{?dist}.1 +Release: 16%{?dist} License: GPLv3+ URL: https://sourceware.org/binutils @@ -277,12 +277,12 @@ Patch33: binutils-CVE-2019-14444.patch # Purpose: Fix a potential seg-fault in the BFD library when parsing # pathalogical debug_info sections. -# Lifetime: Fixed in 2.34 +# Lifetime: Fixed in 2.34 Patch34: binutils-CVE-2019-17451.patch # Purpose: Fix a memory exhaustion bug in the BFD library when parsing # corrupt DWARF debug information. -# Lifetime: Fixed in 2.34 +# Lifetime: Fixed in 2.34 Patch35: binutils-CVE-2019-17450.patch # Purpose: Add a feature to the x86/64 assembler to create @@ -290,6 +290,11 @@ Patch35: binutils-CVE-2019-17450.patch # Lifetime: Fixed in 2.34 Patch36: binutils-x86-JCC-Errata.patch +# Purpose: Stop the linker's garbage collection feature from removing +# aliases for weak symbols. +# Lifetime: Fixed in 2.35 +Patch37: binutils-keep-weak-aliases.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -461,6 +466,7 @@ using libelf instead of BFD. %patch34 -p1 %patch35 -p1 %patch36 -p1 +%patch37 -p1 # We cannot run autotools as there is an exact requirement of autoconf-2.59. # FIXME - this is no longer true. Maybe try reinstating autotool use ? @@ -905,10 +911,13 @@ exit 0 #---------------------------------------------------------------------------- %changelog -* Tue Jan 07 2020 Nick Clifton - 2.32-14.1 +* Tue Feb 18 2020 Nick Clifton - 2.32-16 +- Stop the linker's garbage collection feature from removing aliases for weak symbols. (#1804325) + +* Wed Dec 04 2019 Nick Clifton - 2.32-15 - Fix a potential seg-fault in the BFD library when parsing pathalogical debug_info sections. (#1779255) - Fix a potential memory exhaustion in the BFD library when parsing corrupt DWARF debug information. -- Backport H.J.Lu's patch to add a workaround for the JCC Errata to the assembler. (#1788503) +- Backport H.J.Lu's patch to add a workaround for the JCC Errata to the assembler. (#1779698) * Wed Aug 21 2019 Nick Clifton - 2.32-14 - Fix potential integer overflow in readelf. (#1740470)