diff options
author | Alan Modra <amodra@gmail.com> | 2014-02-12 21:08:01 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2014-02-12 22:10:09 +1030 |
commit | b407645f7ef086a9a527c8f62499b4255868e748 (patch) | |
tree | e1c481521aadf60457ae35029d499b2893d18f46 /bfd | |
parent | 93ffa5b939aef24f7530a8a400f877bfb24f0a73 (diff) | |
download | gdb-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')
-rw-r--r-- | bfd/ChangeLog | 8 | ||||
-rw-r--r-- | bfd/elf64-ppc.c | 9 | ||||
-rw-r--r-- | bfd/elflink.c | 11 |
3 files changed, 21 insertions, 7 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 2117f41..391099a 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,11 @@ +2014-02-12 Alan Modra <amodra@gmail.com> + + 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. + 2014-02-10 H.J. Lu <hongjiu.lu@intel.com> PR gold/16530 diff --git a/bfd/elf64-ppc.c b/bfd/elf64-ppc.c index 9be8bfc..5d77961 100644 --- a/bfd/elf64-ppc.c +++ b/bfd/elf64-ppc.c @@ -6153,6 +6153,7 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf) struct bfd_link_info *info = (struct bfd_link_info *) inf; struct ppc_link_hash_entry *eh = (struct ppc_link_hash_entry *) h; struct ppc_link_hash_entry *fdh; + struct bfd_elf_dynamic_list *d = info->dynamic_list; /* Dynamic linking info is on the func descriptor sym. */ fdh = defined_func_desc (eh); @@ -6162,10 +6163,14 @@ ppc64_elf_gc_mark_dynamic_ref (struct elf_link_hash_entry *h, void *inf) if ((eh->elf.root.type == bfd_link_hash_defined || eh->elf.root.type == bfd_link_hash_defweak) && (eh->elf.ref_dynamic - || (!info->executable - && eh->elf.def_regular + || (eh->elf.def_regular && ELF_ST_VISIBILITY (eh->elf.other) != STV_INTERNAL && ELF_ST_VISIBILITY (eh->elf.other) != STV_HIDDEN + && (!info->executable + || 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 || !bfd_hide_sym_by_version (info->version_info, eh->elf.root.root.string))))) 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))))) |