summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2014-01-19 04:39:14 +0000
committerMike Frysinger <vapier@gentoo.org>2014-01-19 04:39:14 +0000
commit57d9d5aabf9fab6cbe37a12fb435a88f0bf9bbb8 (patch)
tree401e8e065d3ef6823d6fa6480476e9fb90706766 /src/patchsets/binutils
parentmattst88 is no longer involved in catalyst development. (diff)
downloadgentoo-57d9d5aabf9fab6cbe37a12fb435a88f0bf9bbb8.tar.gz
gentoo-57d9d5aabf9fab6cbe37a12fb435a88f0bf9bbb8.tar.bz2
gentoo-57d9d5aabf9fab6cbe37a12fb435a88f0bf9bbb8.zip
add fix from upstream for --as-needed handling #497976 by Lars Wendler
Diffstat (limited to 'src/patchsets/binutils')
-rw-r--r--src/patchsets/binutils/2.24/24_all_as-needed.patch48
-rw-r--r--src/patchsets/binutils/2.24/README.history3
2 files changed, 51 insertions, 0 deletions
diff --git a/src/patchsets/binutils/2.24/24_all_as-needed.patch b/src/patchsets/binutils/2.24/24_all_as-needed.patch
new file mode 100644
index 0000000000..298b7a73ae
--- /dev/null
+++ b/src/patchsets/binutils/2.24/24_all_as-needed.patch
@@ -0,0 +1,48 @@
+https://bugs.gentoo.org/497976
+
+From 72f758d066732d56d50851a97dd67a31f331e2b3 Mon Sep 17 00:00:00 2001
+From: Alan Modra <amodra@gmail.com>
+Date: Sun, 8 Dec 2013 15:26:12 +1030
+Subject: [PATCH] Fix --as-needed undefined symbol references from dynamic
+ libraries.
+
+libx.so refers to some_sym, liby.so provides some_sym@some_version
+wasn't seen as satisfying the reference.
+
+ * elflink.c (_bfd_elf_add_default_symbol): Set dynamic_def
+ and ref_dynamic_nonweak when chaining together indirect
+ symbols.
+---
+ bfd/ChangeLog | 6 ++++++
+ bfd/elflink.c | 8 ++++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/bfd/elflink.c b/bfd/elflink.c
+index 99b7ca1..78eb67b 100644
+--- a/bfd/elflink.c
++++ b/bfd/elflink.c
+@@ -1702,6 +1702,12 @@ _bfd_elf_add_default_symbol (bfd *abfd,
+ ht = (struct elf_link_hash_entry *) hi->root.u.i.link;
+ (*bed->elf_backend_copy_indirect_symbol) (info, ht, hi);
+
++ /* A reference to the SHORTNAME symbol from a dynamic library
++ will be satisfied by the versioned symbol at runtime. In
++ effect, we have a reference to the versioned symbol. */
++ ht->ref_dynamic_nonweak |= hi->ref_dynamic_nonweak;
++ hi->dynamic_def |= ht->dynamic_def;
++
+ /* See if the new flags lead us to realize that the symbol must
+ be dynamic. */
+ if (! *dynsym)
+@@ -1771,6 +1777,8 @@ nondefault:
+ if (hi->root.type == bfd_link_hash_indirect)
+ {
+ (*bed->elf_backend_copy_indirect_symbol) (info, h, hi);
++ h->ref_dynamic_nonweak |= hi->ref_dynamic_nonweak;
++ hi->dynamic_def |= h->dynamic_def;
+
+ /* See if the new flags lead us to realize that the symbol
+ must be dynamic. */
+--
+1.8.4.3
+
diff --git a/src/patchsets/binutils/2.24/README.history b/src/patchsets/binutils/2.24/README.history
index 5709f37a95..355b57abe4 100644
--- a/src/patchsets/binutils/2.24/README.history
+++ b/src/patchsets/binutils/2.24/README.history
@@ -1,3 +1,6 @@
+1.3 18 Jan 2014
+ + 24_all_as-needed.patch
+
1.2 13 Jan 2014
+ 25_all_plugins-dl-search.patch