aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2014-02-12 21:08:01 +1030
committerAlan Modra <amodra@gmail.com>2014-02-12 22:10:09 +1030
commitb407645f7ef086a9a527c8f62499b4255868e748 (patch)
treee1c481521aadf60457ae35029d499b2893d18f46 /bfd/elflink.c
parent93ffa5b939aef24f7530a8a400f877bfb24f0a73 (diff)
downloadgdb-b407645f7ef086a9a527c8f62499b4255868e748.zip
gdb-b407645f7ef086a9a527c8f62499b4255868e748.tar.gz
gdb-b407645f7ef086a9a527c8f62499b4255868e748.tar.bz2
PR15530, mark symbol in executables if it matches dynamic_list
For powerpc64 as HJ did earlier for other ELF targets, and a tidy. PR gold/15530 * elf64-ppc.c (ppc64_elf_gc_mark_dynamic_ref): Support --export-dynamic and --dynamic-list marking of symbols. * elflink.c (bfd_elf_gc_mark_dynamic_ref_symbol): Reorder cheap tests first.
Diffstat (limited to 'bfd/elflink.c')
-rw-r--r--bfd/elflink.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/bfd/elflink.c b/bfd/elflink.c
index b196203..28ccf53 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -12145,13 +12145,14 @@ bfd_elf_gc_mark_dynamic_ref_symbol (struct elf_link_hash_entry *h, void *inf)
if ((h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak)
&& (h->ref_dynamic
- || ((!info->executable
- || info->export_dynamic
- || (d != NULL
- && (*d->match) (&d->head, NULL, h->root.root.string)))
- && h->def_regular
+ || (h->def_regular
&& ELF_ST_VISIBILITY (h->other) != STV_INTERNAL
&& ELF_ST_VISIBILITY (h->other) != STV_HIDDEN
+ && (!info->executable
+ || info->export_dynamic
+ || (h->dynamic
+ && d != NULL
+ && (*d->match) (&d->head, NULL, h->root.root.string)))
&& (strchr (h->root.root.string, ELF_VER_CHR) != NULL
|| !bfd_hide_sym_by_version (info->version_info,
h->root.root.string)))))