Update ppc64_elf_gc_mark_dynamic_ref
authorAlan Modra <amodra@gmail.com>
Tue, 14 Feb 2017 05:29:13 +0000 (15:59 +1030)
committerAlan Modra <amodra@gmail.com>
Tue, 14 Feb 2017 10:42:07 +0000 (21:12 +1030)
* elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
--gc-keep-exported, and test versioned field of sym rather than
looking for @ in name.

bfd/ChangeLog
bfd/elf64-ppc.c

index db620e27bc6adb7a08527c16d5e8d70c85112b6a..252c1d5b0b933c12c829d37137f0297d909868f9 100644 (file)
@@ -1,3 +1,9 @@
+2017-02-14  Alan Modra  <amodra@gmail.com>
+
+       * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support
+       --gc-keep-exported, and test versioned field of sym rather than
+       looking for @ in name.
+
 2017-02-13  Palmer Dabbelt  <palmer@dabbelt.com>
 
        * elfnn-riscv.c (riscv_global_pointer_value): Change _gp to
index 1c77cc62848f4b86fa14b8bb0ab5dc1cb7524666..ad5438462fd15030cd157301c93ddc8387b0d5eb 100644 (file)
@@ -6413,11 +6413,12 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf)
              && ELF_ST_VISIBILITY (eh->elf.other) != STV_INTERNAL
              && ELF_ST_VISIBILITY (eh->elf.other) != STV_HIDDEN
              && (!bfd_link_executable (info)
+                 || info->gc_keep_exported
                  || info->export_dynamic
                  || (eh->elf.dynamic
                      && d != NULL
                      && (*d->match) (&d->head, NULL, eh->elf.root.root.string)))
-             && (strchr (eh->elf.root.root.string, ELF_VER_CHR) != NULL
+             && (eh->elf.versioned >= versioned
                  || !bfd_hide_sym_by_version (info->version_info,
                                               eh->elf.root.root.string)))))
     {