aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-sh64.c
diff options
context:
space:
mode:
authorKaz Kojima <kkojima@rr.iij4u.or.jp>2003-10-15 06:23:55 +0000
committerKaz Kojima <kkojima@rr.iij4u.or.jp>2003-10-15 06:23:55 +0000
commit46e993b970891cc96da82849a3b22fd769fe609a (patch)
tree7fe6d347d890b6ba47e0049f5d23dcc9d90d9cd3 /bfd/elf32-sh64.c
parent3d390fc11a544515512973496879f277ef64fc42 (diff)
downloadgdb-46e993b970891cc96da82849a3b22fd769fe609a.zip
gdb-46e993b970891cc96da82849a3b22fd769fe609a.tar.gz
gdb-46e993b970891cc96da82849a3b22fd769fe609a.tar.bz2
[bfd]
* elf32-sh.c (sh_elf_relocate_section): Handle R_SH_IMM_*_PCREL relocations. (sh_elf_check_relocs): Likewise. * elf32-sh64.c (elf_backend_merge_symbol_attribute): Define. (sh64_elf_merge_symbol_attribute): New. * elf64-sh64.c (elf_backend_merge_symbol_attribute): Define. (sh64_elf64_merge_symbol_attribute): New. [ld/testsuite] * ld-sh/sh64/rd-sh64.exp: If the test matches *-dso.d, copy the output of linker to the file tmpdir/*-dso.so. * ld-sh/sh64/stobin-0-dso.d: New. * ld-sh/sh64/stobin-1.d: New. * ld-sh/sh64/stobin.s: New. * ld-sh/sh64/stolib.s: New.
Diffstat (limited to 'bfd/elf32-sh64.c')
-rw-r--r--bfd/elf32-sh64.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/bfd/elf32-sh64.c b/bfd/elf32-sh64.c
index 288003e..c3be09f 100644
--- a/bfd/elf32-sh64.c
+++ b/bfd/elf32-sh64.c
@@ -85,6 +85,7 @@ static void sh64_find_section_for_address
#define elf_backend_add_symbol_hook sh64_elf_add_symbol_hook
#define elf_backend_link_output_symbol_hook \
sh64_elf_link_output_symbol_hook
+#define elf_backend_merge_symbol_attribute sh64_elf_merge_symbol_attribute
#define elf_backend_final_write_processing sh64_elf_final_write_processing
#define elf_backend_section_from_shdr sh64_backend_section_from_shdr
#define elf_backend_special_sections sh64_elf_special_sections
@@ -735,6 +736,27 @@ sh64_elf_final_write_processing (bfd *abfd,
}
}
+/* Merge non visibility st_other attribute when the symbol comes from
+ a dynamic object. */
+static void
+sh64_elf_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_elf_special_sections[]=
{
{ ".cranges", 8, 0, SHT_PROGBITS, 0 },