diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2011-10-18 19:06:50 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2011-10-18 19:06:50 +0000 |
commit | d6304b56b08fb0dd0c1474789f35a0d0bc03b3a1 (patch) | |
tree | 47468326bb424a98edae52e35c7cb21fa7f9683d | |
parent | 95d474f89f8129e68800de9c8c0423b6d5105882 (diff) | |
download | gdb-d6304b56b08fb0dd0c1474789f35a0d0bc03b3a1.zip gdb-d6304b56b08fb0dd0c1474789f35a0d0bc03b3a1.tar.gz gdb-d6304b56b08fb0dd0c1474789f35a0d0bc03b3a1.tar.bz2 |
Revert the fix for PR ld/13177.
bfd/
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.
ld/testsuite/
2011-10-18 H.J. Lu <hongjiu.lu@intel.com>
PR ld/13177
* ld-elf/pr13177.d: Removed.
* ld-elf/pr13177.s: Likewise.
-rw-r--r-- | bfd/ChangeLog | 6 | ||||
-rw-r--r-- | bfd/elflink.c | 15 | ||||
-rw-r--r-- | ld/testsuite/ChangeLog | 6 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr13177.d | 12 | ||||
-rw-r--r-- | ld/testsuite/ld-elf/pr13177.s | 9 |
5 files changed, 17 insertions, 31 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 8adb600..cfd1fcc 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,9 @@ +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> diff --git a/bfd/elflink.c b/bfd/elflink.c index 5d181f7..33a1a63 100644 --- a/bfd/elflink.c +++ b/bfd/elflink.c @@ -11691,18 +11691,13 @@ 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) - || (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); } diff --git a/ld/testsuite/ChangeLog b/ld/testsuite/ChangeLog index c658c05..4889ea6 100644 --- a/ld/testsuite/ChangeLog +++ b/ld/testsuite/ChangeLog @@ -1,3 +1,9 @@ +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 diff --git a/ld/testsuite/ld-elf/pr13177.d b/ld/testsuite/ld-elf/pr13177.d deleted file mode 100644 index e56e865..0000000 --- a/ld/testsuite/ld-elf/pr13177.d +++ /dev/null @@ -1,12 +0,0 @@ -#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 -#... diff --git a/ld/testsuite/ld-elf/pr13177.s b/ld/testsuite/ld-elf/pr13177.s deleted file mode 100644 index d7caad3..0000000 --- a/ld/testsuite/ld-elf/pr13177.s +++ /dev/null @@ -1,9 +0,0 @@ - .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 |