aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-x86-64.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2003-05-05 14:12:05 +0000
committerAlan Modra <amodra@gmail.com>2003-05-05 14:12:05 +0000
commit4e795f50c1c5f7e59a8ab1f127bc5267d81600f1 (patch)
treec12accdbcf0bc42bfecc1c143f6e035e353817a2 /bfd/elf64-x86-64.c
parent1b883d351364d8b9e00021462e06d5dba0d61460 (diff)
downloadgdb-4e795f50c1c5f7e59a8ab1f127bc5267d81600f1.zip
gdb-4e795f50c1c5f7e59a8ab1f127bc5267d81600f1.tar.gz
gdb-4e795f50c1c5f7e59a8ab1f127bc5267d81600f1.tar.bz2
* elf32-i386.c (allocate_dynrelocs): For undef weak syms with
non-default visibility, a) don't make them dynamic, b) discard space for dynamic relocs. * elf64-x86-64.c (allocate_dynrelocs): Likewise. * elf32-ppc.c (allocate_dynrelocs): For undef weak syms with non-default visibility, a) don't allocate plt entries, b) don't allocate .got relocs, c) discard dyn rel space, (ppc_elf_relocate_section): d) don't generate .got relocs, e) don't generate dynamic relocs. * elf64-ppc.c (allocate_dynrelocs): As above. (ppc64_elf_relocate_section): As above.
Diffstat (limited to 'bfd/elf64-x86-64.c')
-rw-r--r--bfd/elf64-x86-64.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/bfd/elf64-x86-64.c b/bfd/elf64-x86-64.c
index f8d2a0c..c0ce57d 100644
--- a/bfd/elf64-x86-64.c
+++ b/bfd/elf64-x86-64.c
@@ -1385,7 +1385,9 @@ allocate_dynrelocs (h, inf)
htab = elf64_x86_64_hash_table (info);
if (htab->elf.dynamic_sections_created
- && h->plt.refcount > 0)
+ && h->plt.refcount > 0
+ && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
+ || h->root.type != bfd_link_hash_undefweak))
{
/* Make sure this symbol is output as a dynamic symbol.
Undefined weak syms won't yet be marked as dynamic. */
@@ -1396,9 +1398,7 @@ allocate_dynrelocs (h, inf)
return FALSE;
}
- if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT
- || h->root.type != bfd_link_hash_undefweak)
- && WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
+ if (WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, info, h))
{
asection *s = htab->splt;
@@ -1516,6 +1516,12 @@ allocate_dynrelocs (h, inf)
pp = &p->next;
}
}
+
+ /* Also discard relocs on undefined weak syms with non-default
+ visibility. */
+ if (ELF_ST_VISIBILITY (h->other) != STV_DEFAULT
+ && h->root.type == bfd_link_hash_undefweak)
+ eh->dyn_relocs = NULL;
}
else if (ELIMINATE_COPY_RELOCS)
{