diff options
author | H.J. Lu <hjl.tools@gmail.com> | 2003-05-05 05:46:53 +0000 |
---|---|---|
committer | H.J. Lu <hjl.tools@gmail.com> | 2003-05-05 05:46:53 +0000 |
commit | ef5aade5aca46a8f4244c7185fecbadbc32e50fa (patch) | |
tree | ce0667846200306b0d014e816dd21bd8f6a6aaab /bfd/elflink.h | |
parent | 839efa267fa3c2517d3f5072102a03415f7bad5a (diff) | |
download | gdb-ef5aade5aca46a8f4244c7185fecbadbc32e50fa.zip gdb-ef5aade5aca46a8f4244c7185fecbadbc32e50fa.tar.gz gdb-ef5aade5aca46a8f4244c7185fecbadbc32e50fa.tar.bz2 |
bfd/
2003-05-04 H.J. Lu <hjl@gnu.org>
* elf32-i386.c (allocate_dynrelocs): Don't allocate dynamic
relocation entries for weak undefined symbols with non-default
visibility.
(elf_i386_relocate_section): Initialize the GOT entries and
skip R_386_32/R_386_PC32 for weak undefined symbols with
non-default visibility.
* elfxx-ia64.c (allocate_fptr): Don't allocate function
descriptors for weak undefined symbols with non-default
visibility.
(allocate_dynrel_entries): Don't allocate relocation entries
for symbols resolved to 0.
(set_got_entry): Don't install dynamic relocation for weak
undefined symbols with non-default visibility.
(set_pltoff_entry): Likewise.
* elflink.h (elf_fix_symbol_flags): Hide weak undefined symbols
with non-default visibility.
(elf_link_output_extsym): Don't make weak undefined symbols
with non-default visibility dynamic.
ld/testsuite/
2003-05-04 H.J. Lu <hjl@gnu.org>
* ld-elfvsb/main.c: Updated.
* ld-elfvsb/sh1.c: Likewise.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r-- | bfd/elflink.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h index dfcce7d..0f590a4 100644 --- a/bfd/elflink.h +++ b/bfd/elflink.h @@ -4151,6 +4151,16 @@ elf_fix_symbol_flags (h, eif) (*bed->elf_backend_hide_symbol) (eif->info, h, force_local); } + /* If a weak undefined symbol has non-default visibility, we also + hide it from the dynamic linker. */ + if (ELF_ST_VISIBILITY (h->other) + && h->root.type == bfd_link_hash_undefweak) + { + struct elf_backend_data *bed; + bed = get_elf_backend_data (elf_hash_table (eif->info)->dynobj); + (*bed->elf_backend_hide_symbol) (eif->info, h, TRUE); + } + /* If this is a weak defined symbol in a dynamic object, and we know the real definition in the dynamic object, copy interesting flags over to the real definition. */ @@ -6546,7 +6556,9 @@ elf_link_output_extsym (h, data) forced local syms when non-shared is due to a historical quirk. */ if ((h->dynindx != -1 || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) != 0) - && (finfo->info->shared + && ((finfo->info->shared + && (ELF_ST_VISIBILITY (h->other) == STV_DEFAULT + || h->root.type != bfd_link_hash_undefweak)) || (h->elf_link_hash_flags & ELF_LINK_FORCED_LOCAL) == 0) && elf_hash_table (finfo->info)->dynamic_sections_created) { |