diff options
Diffstat (limited to 'bfd')
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elflink.c | 15 |
2 files changed, 16 insertions, 5 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index b063de9..3521289 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,5 +1,11 @@ 2011-09-15 H.J. Lu <hongjiu.lu@intel.com> + PR ld/13177 + * elflink.c (elf_gc_sweep_symbol): Also hide symbols without PLT + nor GOT references. + +2011-09-15 H.J. Lu <hongjiu.lu@intel.com> + PR ld/12975 * bfd-in.h (bfd_elf_size_dynamic_sections): Remove pointer to struct bfd_elf_version_tree. diff --git a/bfd/elflink.c b/bfd/elflink.c index 2560104..9ccf37d 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -11689,13 +11689,18 @@ struct elf_gc_sweep_symbol_info static bfd_boolean elf_gc_sweep_symbol (struct elf_link_hash_entry *h, void *data) { - if ((h->root.type == bfd_link_hash_defined - || h->root.type == bfd_link_hash_defweak) - && !h->root.u.def.section->gc_mark - && !(h->root.u.def.section->owner->flags & DYNAMIC)) + if (((h->root.type == bfd_link_hash_defined + || h->root.type == bfd_link_hash_defweak) + && !h->root.u.def.section->gc_mark + && (!(h->root.u.def.section->owner->flags & DYNAMIC) + || (h->plt.refcount <= 0 + && h->got.refcount <= 0))) + || (h->root.type == bfd_link_hash_undefined + && h->plt.refcount <= 0 + && h->got.refcount <= 0)) { struct elf_gc_sweep_symbol_info *inf = - (struct elf_gc_sweep_symbol_info *) data; + (struct elf_gc_sweep_symbol_info *) data; (*inf->hide_symbol) (inf->info, h, TRUE); } |