diff options
author | Alan Modra <amodra@gmail.com> | 2020-11-30 19:19:00 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2020-12-01 11:26:35 +1030 |
commit | 5160d0f323d47031cb73c39a4dbd31d8976b4c8e (patch) | |
tree | 59710941879e3598ddc359511388a9a5384ef271 /bfd/elfxx-mips.c | |
parent | 3ca6a4e547924828ec1428eda78217b30fae809c (diff) | |
download | gdb-5160d0f323d47031cb73c39a4dbd31d8976b4c8e.zip gdb-5160d0f323d47031cb73c39a4dbd31d8976b4c8e.tar.gz gdb-5160d0f323d47031cb73c39a4dbd31d8976b4c8e.tar.bz2 |
PR26979, Visibility of undefined foo@v1 should constrain foo@@v1
Also, undefined foo should constrain the visibility of foo@@v1 just as
it does for a later plain foo definition.
bfd/
PR 26979
* elf-bfd.h (elf_backend_merge_symbol_attribute): Update prototype.
* elf32-m68hc1x.h (elf32_m68hc11_merge_symbol_attribute): Likewise.
* elfxx-mips.h (_bfd_mips_elf_merge_symbol_attribute): Likewise.
* elfxx-x86.h (_bfd_x86_elf_merge_symbol_attribute): Likewise.
* elf32-m68hc1x.c (elf32_m68hc11_merge_symbol_attribute): Replace
isym parameter with st_other. Adjust code.
* elf64-alpha.c (elf64_alpha_merge_symbol_attribute): Likewise.
* elf64-ppc.c (ppc64_elf_merge_symbol_attribute): Likewise.
* elfnn-aarch64.c (elfNN_aarch64_merge_symbol_attribute): Likewise.
* elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): Likewise.
* elfxx-x86.c (_bfd_x86_elf_merge_symbol_attribute): Likewise.
* elflink.c (elf_merge_st_other): Likewise.
(_bfd_elf_merge_symbol, elf_link_add_object_symbols): Adjust to suit.
(_bfd_elf_copy_link_hash_symbol_type): Likewise.
(_bfd_elf_add_default_symbol): Merge st_other from undecorated
symbol and @VER symbol to @@VER symbol.
ld/
* testsuite/ld-elf/pr26979a.s,
* testsuite/ld-elf/pr26979b.s,
* testsuite/ld-elf/pr26979c.s,
* testsuite/ld-elf/pr26979.ver,
* testsuite/ld-elf/pr26979a.d,
* testsuite/ld-elf/pr26979b.d: New tests.
Diffstat (limited to 'bfd/elfxx-mips.c')
-rw-r--r-- | bfd/elfxx-mips.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index c0970fb..4ea04d4 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -16320,21 +16320,21 @@ const struct bfd_elf_special_section _bfd_mips_elf_special_sections[] = definiton of the symbol. */ void _bfd_mips_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, - const Elf_Internal_Sym *isym, + unsigned int st_other, bfd_boolean definition, bfd_boolean dynamic ATTRIBUTE_UNUSED) { - if ((isym->st_other & ~ELF_ST_VISIBILITY (-1)) != 0) + if ((st_other & ~ELF_ST_VISIBILITY (-1)) != 0) { unsigned char other; - other = (definition ? isym->st_other : h->other); + other = (definition ? st_other : h->other); other &= ~ELF_ST_VISIBILITY (-1); h->other = other | ELF_ST_VISIBILITY (h->other); } if (!definition - && ELF_MIPS_IS_OPTIONAL (isym->st_other)) + && ELF_MIPS_IS_OPTIONAL (st_other)) h->other |= STO_OPTIONAL; } |