Set dynamic tag VMA and size from dynamic section when possible
[deliverable/binutils-gdb.git] / bfd / elf32-nds32.c
index 60cd51edce82494479075f2dff9cd92544729b6f..4f3522abf56fa8a7092d5a00991d73007a83b2fa 100644 (file)
@@ -5710,20 +5710,17 @@ nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
              break;
 
            case DT_PLTGOT:
-             /* name = ".got"; */
-             s = htab->sgot->output_section;
+             s = htab->sgotplt;
              goto get_vma;
            case DT_JMPREL:
-             s = htab->srelplt->output_section;
+             s = htab->srelplt;
            get_vma:
-             BFD_ASSERT (s != NULL);
-             dyn.d_un.d_ptr = s->vma;
+             dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
              break;
 
            case DT_PLTRELSZ:
-             s = htab->srelplt->output_section;
-             BFD_ASSERT (s != NULL);
+             s = htab->srelplt;
              dyn.d_un.d_val = s->size;
              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
              break;
@@ -5740,7 +5737,7 @@ nds32_elf_finish_dynamic_sections (bfd *output_bfd, struct bfd_link_info *info)
                 about changing the DT_RELA entry.  */
              if (htab->srelplt != NULL)
                {
-                 s = htab->srelplt->output_section;
+                 s = htab->srelplt;
                  dyn.d_un.d_val -= s->size;
                }
              bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
This page took 0.027095 seconds and 4 git commands to generate.