Fix --as-needed undefined symbol references from dynamic libraries.
authorAlan Modra <amodra@gmail.com>
Sun, 8 Dec 2013 04:56:12 +0000 (15:26 +1030)
committerAlan Modra <amodra@gmail.com>
Sun, 8 Dec 2013 05:03:29 +0000 (15:33 +1030)
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.

bfd/ChangeLog
bfd/elflink.c

index 4a2bc286a31a173c4489648a290fd8c074ccab5d..a7bc1ef30bb6d765f6d0a37d0accf87d17f081ec 100644 (file)
@@ -1,3 +1,9 @@
+2013-12-08  Alan Modra  <amodra@gmail.com>
+
+       * elf64-ppc.c (_bfd_elf_add_default_symbol): Set dynamic_def
+       and ref_dynamic_nonweak when chaining together indirect
+       symbols.
+
 2013-12-06  Tristan Gingold  <gingold@adacore.com>
 
        * pei-x86_64.c (pex64_xdata_print_uwd_codes): Add argument rf.
index 1e6abd9df8d30e9f3968c2519816851dabece15b..6fa62f9b0bec20106c3f7fa50c4d33b42c9607ce 100644 (file)
@@ -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.  */
This page took 0.03918 seconds and 4 git commands to generate.