diff options
author | Alan Modra <amodra@bigpond.net.au> | 2002-08-23 08:13:12 +0000 |
---|---|---|
committer | Alan Modra <amodra@bigpond.net.au> | 2002-08-23 08:13:12 +0000 |
commit | 73e4511204cca4168e4506bf9cab38ea322442cc (patch) | |
tree | e75fa376efc8e06c0a69a405768f4da239da8db8 /bfd | |
parent | 9fa46dfa68b131075dc9026c725f5f9b9728fd0b (diff) | |
download | gdb-73e4511204cca4168e4506bf9cab38ea322442cc.tar.gz |
* 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')
-rw-r--r-- | bfd/ChangeLog | 11 | ||||
-rw-r--r-- | bfd/elf32-sh.c | 22 | ||||
-rw-r--r-- | bfd/elf64-sh64.c | 20 |
3 files changed, 51 insertions, 2 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 5b95fe938cb..015dec42c7f 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,8 +1,15 @@ +2002-08-23 Stephen Clarke <stephen.clarke@superh.com>, + Richard Shann <richard.shann@superh.com> + + * 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. + 2002-08-23 Stephen Clarke <stephen.clarke@superh.com> - * bfd/elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize + * elf32-sh.c (sh_elf_size_dynamic_sections): Zero initialize dynamic section. - * bfd/elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. + * elf64-sh64.c (sh64_elf64_size_dynamic_sections): Likewise. 2002-08-22 Kaz Kojima <kkojima@rr.iij4u.or.jp> diff --git a/bfd/elf32-sh.c b/bfd/elf32-sh.c index b31a2a6d88e..295fe0b221a 100644 --- a/bfd/elf32-sh.c +++ b/bfd/elf32-sh.c @@ -5697,6 +5697,7 @@ sh_elf_finish_dynamic_sections (output_bfd, info) Elf_Internal_Dyn dyn; const char *name; asection *s; + struct elf_link_hash_entry *h; bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); @@ -5705,6 +5706,27 @@ sh_elf_finish_dynamic_sections (output_bfd, info) default: break; +#ifdef INCLUDE_SHMEDIA + 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_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + } + } + break; +#endif + case DT_PLTGOT: name = ".got"; goto get_vma; diff --git a/bfd/elf64-sh64.c b/bfd/elf64-sh64.c index 48e7e497b68..9db630106f1 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; |