diff options
Diffstat (limited to 'bfd/elf32-i370.c')
-rw-r--r-- | bfd/elf32-i370.c | 44 |
1 files changed, 24 insertions, 20 deletions
diff --git a/bfd/elf32-i370.c b/bfd/elf32-i370.c index 7427995..940fc9d 100644 --- a/bfd/elf32-i370.c +++ b/bfd/elf32-i370.c @@ -884,7 +884,7 @@ i370_elf_finish_dynamic_sections (bfd *output_bfd, { asection *sdyn; bfd *dynobj = elf_hash_table (info)->dynobj; - asection *sgot = bfd_get_linker_section (dynobj, ".got"); + asection *sgot = elf_hash_table (info)->sgot; #ifdef DEBUG fprintf (stderr, "i370_elf_finish_dynamic_sections called\n"); @@ -897,7 +897,7 @@ i370_elf_finish_dynamic_sections (bfd *output_bfd, asection *splt; Elf32_External_Dyn *dyncon, *dynconend; - splt = bfd_get_linker_section (dynobj, ".plt"); + splt = elf_hash_table (info)->splt; BFD_ASSERT (splt != NULL && sdyn != NULL); dyncon = (Elf32_External_Dyn *) sdyn->contents; @@ -905,35 +905,39 @@ i370_elf_finish_dynamic_sections (bfd *output_bfd, for (; dyncon < dynconend; dyncon++) { Elf_Internal_Dyn dyn; - const char *name; + asection *s; bfd_boolean size; bfd_elf32_swap_dyn_in (dynobj, dyncon, &dyn); switch (dyn.d_tag) { - case DT_PLTGOT: name = ".plt"; size = FALSE; break; - case DT_PLTRELSZ: name = ".rela.plt"; size = TRUE; break; - case DT_JMPREL: name = ".rela.plt"; size = FALSE; break; - default: name = NULL; size = FALSE; break; + case DT_PLTGOT: + s = elf_hash_table (info)->splt; + size = FALSE; + break; + case DT_PLTRELSZ: + s = elf_hash_table (info)->srelplt; + size = TRUE; + break; + case DT_JMPREL: + s = elf_hash_table (info)->srelplt; + size = FALSE; + break; + default: + continue; } - if (name != NULL) + if (s == NULL) + dyn.d_un.d_val = 0; + else { - asection *s; - - s = bfd_get_linker_section (dynobj, name); - if (s == NULL) - dyn.d_un.d_val = 0; + if (!size) + dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; else - { - if (! size) - dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; - else - dyn.d_un.d_val = s->size; - } - bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); + dyn.d_un.d_val = s->size; } + bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon); } } |