diff options
author | H.J. Lu <hjl@lucon.org> | 2003-05-05 05:46:52 +0000 |
---|---|---|
committer | H.J. Lu <hjl@lucon.org> | 2003-05-05 05:46:52 +0000 |
commit | 6efe98cfbfbeabab56380cf98e7043157703e1ec (patch) | |
tree | 91f7d3da7122caaed90024f02d08d116c285a0a0 /bfd/elflink.h | |
parent | 75a265c0cff445285c86a16d1f16f33498ba4219 (diff) | |
download | gdb-6efe98cfbfbeabab56380cf98e7043157703e1ec.tar.gz |
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 dfcce7d2564..0f590a4c294 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) { |