aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2013-12-08 15:26:12 +1030
committerAlan Modra <amodra@gmail.com>2013-12-08 15:33:29 +1030
commit68c88cd461b697243d5a303997dad273dd4274ce (patch)
treee70f8659367f4f3fe8e9e23953f179d5fc2423bc /bfd/elflink.c
parent0c2242c1929a61f5fcc7ed2f6ee56a1d369ea91a (diff)
downloadgdb-68c88cd461b697243d5a303997dad273dd4274ce.zip
gdb-68c88cd461b697243d5a303997dad273dd4274ce.tar.gz
gdb-68c88cd461b697243d5a303997dad273dd4274ce.tar.bz2
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. * elf64-ppc.c (_bfd_elf_add_default_symbol): Set dynamic_def and ref_dynamic_nonweak when chaining together indirect symbols.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index 1e6abd9..6fa62f9 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. */