diff options
author | Alan Modra <amodra@gmail.com> | 2002-08-23 08:13:12 +0000 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2002-08-23 08:13:12 +0000 |
commit | 3b587c71d7b37cf7b18c71d01f887d13e692c85b (patch) | |
tree | 61f16d4e40ffefc16f371bdc6ef403ca26f5393f /bfd/elf64-sh64.c | |
parent | 8e523c2334366c29b077a870e0cdc6606d16369e (diff) | |
download | gdb-3b587c71d7b37cf7b18c71d01f887d13e692c85b.zip gdb-3b587c71d7b37cf7b18c71d01f887d13e692c85b.tar.gz gdb-3b587c71d7b37cf7b18c71d01f887d13e692c85b.tar.bz2 |
* elf32-sh.c (sh_elf_finish_dynamic_sections): Set LSB of DT_INIT
value if .init is an SHmedia function. Similarly for DT_FINI.
* elf64-sh64.c (sh64_elf64_finish_dynamic_sections): Likewise.
Diffstat (limited to 'bfd/elf64-sh64.c')
-rw-r--r-- | bfd/elf64-sh64.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 48e7e49..9db6301 100644 --- a/bfd/elf64-sh64.c +++ b/bfd/elf64-sh64.c @@ -3990,6 +3990,7 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info) Elf_Internal_Dyn dyn; const char *name; asection *s; + struct elf_link_hash_entry *h; bfd_elf64_swap_dyn_in (dynobj, dyncon, &dyn); @@ -3998,6 +3999,25 @@ sh64_elf64_finish_dynamic_sections (output_bfd, info) default: break; + case DT_INIT: + name = info->init_function; + goto get_sym; + + case DT_FINI: + name = info->fini_function; + get_sym: + if (dyn.d_un.d_val != 0) + { + h = elf_link_hash_lookup (elf_hash_table (info), name, + false, false, true); + if (h != NULL && (h->other & STO_SH5_ISA32)) + { + dyn.d_un.d_val |= 1; + bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; + case DT_PLTGOT: name = ".got"; goto get_vma; |