From a8d02486e9cd8f9f212d131029c7e533c118562f Mon Sep 17 00:00:00 2001 From: Adam Williamson Date: Feb 09 2012 02:48:39 +0000 Subject: Merge commit '92cfe74afd522164b879fa5babcf79f49ef5abe5' into f17 --- diff --git a/binutils-2.22.52.0.1-weakdef.patch b/binutils-2.22.52.0.1-weakdef.patch new file mode 100644 index 0000000..9809611 --- /dev/null +++ b/binutils-2.22.52.0.1-weakdef.patch @@ -0,0 +1,65 @@ +From f5edd1ac0e79c0356c6a1e2beffcadc0c532be98 Mon Sep 17 00:00:00 2001 +From: Alan Modra +Date: Wed, 8 Feb 2012 10:12:19 +0000 +Subject: [PATCH] * elflink.c (_bfd_elf_gc_mark_rsec): Mark weakdef syms too. + (_bfd_elf_fix_symbol_flags): When a weakdef is def_regular, clear + the correct h->u.weakdef. + +--- + bfd/elflink.c | 26 +++++++++++++++----------- + 1 files changed, 15 insertions(+), 11 deletions(-) + +diff --git a/bfd/elflink.c b/bfd/elflink.c +index 1d1ca0b..7f9ec60 100644 +--- a/bfd/elflink.c ++++ b/bfd/elflink.c +@@ -2510,23 +2510,21 @@ _bfd_elf_fix_symbol_flags (struct elf_link_hash_entry *h, + over to the real definition. */ + if (h->u.weakdef != NULL) + { +- struct elf_link_hash_entry *weakdef; +- +- weakdef = h->u.weakdef; +- while (h->root.type == bfd_link_hash_indirect) +- h = (struct elf_link_hash_entry *) h->root.u.i.link; +- +- BFD_ASSERT (h->root.type == bfd_link_hash_defined +- || h->root.type == bfd_link_hash_defweak); +- BFD_ASSERT (weakdef->def_dynamic); +- + /* If the real definition is defined by a regular object file, + don't do anything special. See the longer description in + _bfd_elf_adjust_dynamic_symbol, below. */ +- if (weakdef->def_regular) ++ if (h->u.weakdef->def_regular) + h->u.weakdef = NULL; + else + { ++ struct elf_link_hash_entry *weakdef = h->u.weakdef; ++ ++ while (h->root.type == bfd_link_hash_indirect) ++ h = (struct elf_link_hash_entry *) h->root.u.i.link; ++ ++ BFD_ASSERT (h->root.type == bfd_link_hash_defined ++ || h->root.type == bfd_link_hash_defweak); ++ BFD_ASSERT (weakdef->def_dynamic); + BFD_ASSERT (weakdef->root.type == bfd_link_hash_defined + || weakdef->root.type == bfd_link_hash_defweak); + (*bed->elf_backend_copy_indirect_symbol) (eif->info, weakdef, h); +@@ -11575,6 +11573,12 @@ _bfd_elf_gc_mark_rsec (struct bfd_link_info *info, asection *sec, + || 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->u.weakdef != NULL) ++ h->u.weakdef->mark = 1; + return (*gc_mark_hook) (sec, info, cookie->rel, h, NULL); + } + +-- +1.7.3.4 + + diff --git a/binutils.spec b/binutils.spec index 37c2c64..2cfb243 100644 --- a/binutils.spec +++ b/binutils.spec @@ -17,7 +17,7 @@ Summary: A GNU collection of binary utilities Name: %{?cross}binutils%{?_with_debug:-debug} Version: 2.22.52.0.1 -Release: 2%{?dist} +Release: 4%{?dist} License: GPLv3+ Group: Development/Tools URL: http://sources.redhat.com/binutils @@ -34,6 +34,9 @@ Patch04: binutils-2.20.51.0.2-version.patch Patch05: binutils-2.20.51.0.2-set-long-long.patch Patch06: binutils-2.20.51.0.10-copy-osabi.patch Patch07: binutils-2.20.51.0.10-sec-merge-emit.patch +# Upstream http://sourceware.org/git/?p=binutils.git;a=commitdiff;h=f5edd1ac0e79c0356c6a1e2beffcadc0c532be98 +# Fixes RH #788107 +Patch08: binutils-2.22.52.0.1-weakdef.patch %define gold_arches %ix86 x86_64 @@ -131,6 +134,7 @@ using libelf instead of BFD. %patch05 -p0 -b .set-long-long~ %patch06 -p0 -b .copy-osabi~ %patch07 -p0 -b .sec-merge-emit~ +%patch08 -p1 -b .weakdef~ # We cannot run autotools as there is an exact requirement of autoconf-2.59. @@ -425,6 +429,12 @@ exit 0 %endif # %{isnative} %changelog +* Wed Feb 08 2012 Adam Williamson - 2.22.52.0.1-4 +- actually apply the patch + +* Wed Feb 08 2012 Adam Williamson - 2.22.52.0.1-3 +- add upstream weakdef.patch to fix RH #788107 + * Wed Feb 01 2012 Nick Clifton - 2.22.52.0.1-2 - Drat - forgot to upload the new tarball. Now done.