From 8992f0d7c2d63ad6b5c102572be103791c6a958e Mon Sep 17 00:00:00 2001 From: Thiemo Seufer Date: Tue, 15 Aug 2006 18:28:48 +0000 Subject: * elf32-mips.c, elf64-mips.c, elfn32-mips.c (elf_backend_merge_symbol_attribute): Define. * elflink.c (elf_link_add_object_symbols): Merge only the ELF visibility flags. * elfxx-mips.c (_bfd_mips_elf_merge_symbol_attribute): New function. --- bfd/elfxx-mips.c | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'bfd/elfxx-mips.c') diff --git a/bfd/elfxx-mips.c b/bfd/elfxx-mips.c index 8ebd2f9..cdc81a2 100644 --- a/bfd/elfxx-mips.c +++ b/bfd/elfxx-mips.c @@ -11115,15 +11115,25 @@ const struct bfd_elf_special_section _bfd_mips_elf_special_sections[] = { NULL, 0, 0, 0, 0 } }; -/* Ensure that the STO_OPTIONAL flag is copied into h->other, - even if this is not a defintion of the symbol. */ +/* Merge non visibility st_other attributes. Ensure that the + STO_OPTIONAL flag is copied into h->other, even if this is not a + definiton of the symbol. */ void _bfd_mips_elf_merge_symbol_attribute (struct elf_link_hash_entry *h, const Elf_Internal_Sym *isym, bfd_boolean definition, bfd_boolean dynamic ATTRIBUTE_UNUSED) { - if (! definition + if ((isym->st_other & ~ELF_ST_VISIBILITY (-1)) != 0) + { + unsigned char other; + + other = (definition ? isym->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)) h->other |= STO_OPTIONAL; } -- cgit v1.1