diff options
author | Alan Modra <amodra@gmail.com> | 2003-05-05 14:12:05 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2003-05-05 14:12:05 +0000 |
commit | 4e795f50c1c5f7e59a8ab1f127bc5267d81600f1 (patch) | |
tree | c12accdbcf0bc42bfecc1c143f6e035e353817a2 /bfd/elf32-i386.c | |
parent | 1b883d351364d8b9e00021462e06d5dba0d61460 (diff) | |
download | gdb-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/elf32-i386.c')
-rw-r--r-- | bfd/elf32-i386.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/bfd/elf32-i386.c b/bfd/elf32-i386.c index ac292a1..320e985 100644 --- a/bfd/elf32-i386.c +++ b/bfd/elf32-i386.c @@ -1558,7 +1558,9 @@ allocate_dynrelocs (h, inf) htab = elf_i386_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. */ @@ -1569,10 +1571,8 @@ allocate_dynrelocs (h, inf) return FALSE; } - if ((ELF_ST_VISIBILITY (h->other) == STV_DEFAULT - || h->root.type != bfd_link_hash_undefweak) - && (info->shared - || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h))) + if (info->shared + || WILL_CALL_FINISH_DYNAMIC_SYMBOL (1, 0, h)) { asection *s = htab->splt; @@ -1695,6 +1695,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) { |