diff options
-rw-r--r-- | bfd/elf32-s390.c | 4 | ||||
-rw-r--r-- | bfd/elf64-s390.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/bfd/elf32-s390.c b/bfd/elf32-s390.c index ddbeb97..95682b6 100644 --- a/bfd/elf32-s390.c +++ b/bfd/elf32-s390.c @@ -3941,7 +3941,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, break; case DT_PLTRELSZ: - dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size; + dyn.d_un.d_val = htab->elf.srelplt->size; + if (htab->elf.irelplt) + dyn.d_un.d_val += htab->elf.irelplt->size; break; } diff --git a/bfd/elf64-s390.c b/bfd/elf64-s390.c index 62e3cca..8c5b197 100644 --- a/bfd/elf64-s390.c +++ b/bfd/elf64-s390.c @@ -3745,7 +3745,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, break; case DT_PLTRELSZ: - dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size; + dyn.d_un.d_val = htab->elf.srelplt->size; + if (htab->elf.irelplt) + dyn.d_un.d_val += htab->elf.irelplt->size; break; case DT_RELASZ: @@ -3756,7 +3758,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd, linker script arranges for .rela.plt to follow all other relocation sections, we don't have to worry about changing the DT_RELA entry. */ - dyn.d_un.d_val -= htab->elf.srelplt->size + htab->elf.irelplt->size; + dyn.d_un.d_val -= htab->elf.srelplt->size; + if (htab->elf.irelplt) + dyn.d_un.d_val -= htab->elf.irelplt->size; break; } |