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 97bfdcb..5419164 100644 --- a/SPECS/binutils.spec +++ b/SPECS/binutils.spec @@ -65,7 +65,7 @@ Summary: A GNU collection of binary utilities Name: %{?scl_prefix}%{?cross}binutils%{?_with_debug:-debug} Version: 2.30 -Release: 55%{?dist}.1 +Release: 55%{?dist}.2 License: GPLv3+ Group: Development/Tools URL: https://sourceware.org/binutils @@ -371,6 +371,11 @@ Patch54: binutils-plugins-need-dlsym.patch # Lifetime: Fixed in 2.34 Patch55: binutils-x86-JCC-Errata.patch +# Purpose: Stop the linker's garbage collection feature from removing +# aliases for weak symbols. +# Lifetime: Fixed in 2.35 +Patch56: binutils-keep-weak-aliases.patch + #---------------------------------------------------------------------------- Provides: bundled(libiberty) @@ -560,6 +565,7 @@ using libelf instead of BFD. %patch53 -p1 %patch54 -p1 %patch55 -p1 +%patch56 -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 ? @@ -996,6 +1002,9 @@ exit 0 #---------------------------------------------------------------------------- %changelog +* Wed Feb 19 2020 Nick Clifton - 2.30-55.2 +- Stop the linker's garbage collection feature from removing aliases for weak symbols. (#1804687) + * Sun Dec 08 2019 Nick Clifton - 2.30-55.1 - Add ability to x86 assembler to generate workarounds for Intel JCC flaw. (#1779412)