aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-nios2.c
diff options
context:
space:
mode:
Diffstat (limited to 'bfd/elf32-nios2.c')
-rw-r--r--bfd/elf32-nios2.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/bfd/elf32-nios2.c b/bfd/elf32-nios2.c
index b19169c..bf8f4ce 100644
--- a/bfd/elf32-nios2.c
+++ b/bfd/elf32-nios2.c
@@ -5344,22 +5344,19 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_PLTGOT:
- s = htab->root.sgot;
- BFD_ASSERT (s != NULL);
- dyn.d_un.d_ptr = s->output_section->vma;
+ s = htab->root.sgotplt;
+ dyn.d_un.d_ptr = s->output_section->vma + s->output_offset;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
case DT_JMPREL:
s = htab->root.srelplt;
- BFD_ASSERT (s != NULL);
- dyn.d_un.d_ptr = s->output_section->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->root.srelplt;
- BFD_ASSERT (s != NULL);
dyn.d_un.d_val = s->size;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
@@ -5379,9 +5376,9 @@ nios2_elf32_finish_dynamic_sections (bfd *output_bfd,
break;
case DT_NIOS2_GP:
- s = htab->root.sgot;
- BFD_ASSERT (s != NULL);
- dyn.d_un.d_ptr = s->output_section->vma + 0x7ff0;
+ s = htab->root.sgotplt;
+ dyn.d_un.d_ptr
+ = s->output_section->vma + s->output_offset + 0x7ff0;
bfd_elf32_swap_dyn_out (output_bfd, &dyn, dyncon);
break;
}