+2011-10-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/13177
+ * elflink.c (elf_gc_sweep_symbol): Don't hide symbols without PLT
+ nor GOT references.
+
2011-10-14 Hans-Peter Nilsson <hp@axis.com>
* elf32-cris.c (cris_elf_gc_sweep_hook) <R_CRIS_16_GOTPLT>
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)
- || (h->plt.refcount <= 0
- && h->got.refcount <= 0)))
- || (h->root.type == bfd_link_hash_undefined
- && h->plt.refcount <= 0
- && h->got.refcount <= 0))
+ 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))
{
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);
}
+2011-10-18 H.J. Lu <hongjiu.lu@intel.com>
+
+ PR ld/13177
+ * ld-elf/pr13177.d: Removed.
+ * ld-elf/pr13177.s: Likewise.
+
2011-10-14 Hans-Peter Nilsson <hp@axis.com>
* ld-cris/pic-gc-72.d: Adjust for dropping unused undefined
+++ /dev/null
-#source: pr13177.s
-#ld: --gc-sections -shared
-#readelf: -s -D --wide
-#target: *-*-linux* *-*-gnu*
-#notarget: arc-*-* d30v-*-* dlx-*-* i960-*-* or32-*-* pj*-*-*
-#notarget: hppa64-*-* i370-*-* i860-*-* ia64-*-* mep-*-* mn10200-*-*
-# generic linker targets don't support --gc-sections, nor do a bunch of others
-
-#failif
-#...
-.*: 0+0 +0 +NOTYPE +GLOBAL +DEFAULT +UND bar
-#...
+++ /dev/null
- .section .text.foo,"ax",%progbits
- .globl foo
- .type foo, %function
-foo:
- .byte 0
- .section .data.opt_out,"aw",%progbits
- .type opt_out, %object
-opt_out:
- .dc.a bar