aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-sh64.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf64-sh64.c')
-rw-r--r--bfd/elf64-sh64.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c
index e05145e..1a679d3 100644
--- a/bfd/elf64-sh64.c
+++ b/bfd/elf64-sh64.c
@@ -4118,6 +4118,27 @@ sh64_elf64_finish_dynamic_sections (bfd *output_bfd,
return TRUE;
}
+/* Merge non visibility st_other attribute when the symbol comes from
+ a dynamic object. */
+static void
+sh64_elf64_merge_symbol_attribute (struct elf_link_hash_entry *h,
+ const Elf_Internal_Sym *isym,
+ bfd_boolean definition,
+ bfd_boolean dynamic)
+{
+ if (isym->st_other != 0 && dynamic)
+ {
+ unsigned char other;
+
+ /* Take the balance of OTHER from the definition. */
+ other = (definition ? isym->st_other : h->other);
+ other &= ~ ELF_ST_VISIBILITY (-1);
+ h->other = other | ELF_ST_VISIBILITY (h->other);
+ }
+
+ return;
+}
+
static struct bfd_elf_special_section const sh64_elf64_special_sections[]=
{
{ ".cranges", 8, 0, SHT_PROGBITS, 0 },
@@ -4164,6 +4185,9 @@ static struct bfd_elf_special_section const sh64_elf64_special_sections[]=
#define elf_backend_link_output_symbol_hook \
sh64_elf64_link_output_symbol_hook
+#define elf_backend_merge_symbol_attribute \
+ sh64_elf64_merge_symbol_attribute
+
#define elf_backend_final_write_processing \
sh64_elf64_final_write_processing