summaryrefslogtreecommitdiff
path: root/bfd/elf32-vax.c
diff options
context:
space:
mode:
authorMaciej W. Rozycki <macro@linux-mips.org>2012-08-05 22:45:20 +0000
committerMaciej W. Rozycki <macro@linux-mips.org>2012-08-05 22:45:20 +0000
commita22a8039037163a1d61120e6e6b9feaa27186994 (patch)
tree36c36c206932e3a3d2eb72300cb80df4bdf103a6 /bfd/elf32-vax.c
parent1e5901e69dc9d80d7c864ec0cf9d56b7e5773ee3 (diff)
bfd/
* elf32-vax.c (elf_vax_adjust_dynamic_symbol): Don't allocate PLT slots for local symbols. ld/testsuite/ * ld-vax-elf: New directory. * ld-vax-elf/plt-local-lib.dd: New test. * ld-vax-elf/plt-local-lib.ld: New test linker script. * ld-vax-elf/plt-local-lib.s: New test source. * ld-vax-elf/plt-local.dd: New test. * ld-vax-elf/plt-local.ld: New test linker script. * ld-vax-elf/plt-local.s: New test source. * ld-vax-elf/plt-local-hidden-pic.s: New test source. * ld-vax-elf/plt-local-rehidden-pic.s: New test source. * ld-vax-elf/vax-elf.exp: New test script.
Diffstat (limited to 'bfd/elf32-vax.c')
-rw-r--r--bfd/elf32-vax.c32
1 files changed, 7 insertions, 25 deletions
diff --git a/bfd/elf32-vax.c b/bfd/elf32-vax.c
index 84ec972563..6258d96097 100644
--- a/bfd/elf32-vax.c
+++ b/bfd/elf32-vax.c
@@ -933,39 +933,21 @@ elf_vax_adjust_dynamic_symbol (info, h)
if (h->type == STT_FUNC
|| h->needs_plt)
{
- if (! info->shared
- && !h->def_dynamic
- && !h->ref_dynamic
- /* We must always create the plt entry if it was referenced
- by a PLTxxO relocation. In this case we already recorded
- it as a dynamic symbol. */
- && h->dynindx == -1)
+ if (h->plt.refcount <= 0
+ || SYMBOL_CALLS_LOCAL (info, h)
+ || (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak))
{
/* This case can occur if we saw a PLTxx reloc in an input
file, but the symbol was never referred to by a dynamic
- object. In such a case, we don't actually need to build
- a procedure linkage table, and we can just do a PCxx
- reloc instead. */
- BFD_ASSERT (h->needs_plt);
+ object, or if all references were garbage collected. In
+ such a case, we don't actually need to build a procedure
+ linkage table, and we can just do a PCxx reloc instead. */
h->plt.offset = (bfd_vma) -1;
- return TRUE;
- }
-
- /* GC may have rendered this entry unused. */
- if (h->plt.refcount <= 0)
- {
h->needs_plt = 0;
- h->plt.offset = (bfd_vma) -1;
return TRUE;
}
- /* Make sure this symbol is output as a dynamic symbol. */
- if (h->dynindx == -1)
- {
- if (! bfd_elf_link_record_dynamic_symbol (info, h))
- return FALSE;
- }
-
s = bfd_get_linker_section (dynobj, ".plt");
BFD_ASSERT (s != NULL);