]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
bfd/s390: Fix DT_PLTRELSZ in presence of R_390_IRELATIVE.
authorMarcin Kościelnicki <koriakin@0x04.net>
Wed, 8 Jun 2016 12:01:31 +0000 (14:01 +0200)
committerMarcin Kościelnicki <koriakin@0x04.net>
Wed, 8 Jun 2016 12:01:31 +0000 (14:01 +0200)
This was broken by 4ade44b727ee77adaa9c22719935d012e253a5e6,
which changed the calculation to use the .rela.plt linker section
instead of its output section - thus skipping .rela.iplt .
Fix the calculations to include it.

bfd/ChangeLog:

* elf32-s390.c (elf_s390_finish_dynamic_sections): Include
.rela.iplt in DT_PLTRELSZ.
* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise,
for DT_PLTRELSZ and DT_RELASZ as well.

bfd/elf32-s390.c
bfd/elf64-s390.c

index 9480f7258ac44d646c543a54383fcad34edfe9eb..1f058d295683082ccc9604853b8702fda6b01744 100644 (file)
@@ -3958,8 +3958,7 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
              break;
 
            case DT_PLTRELSZ:
-             s = htab->elf.srelplt;
-             dyn.d_un.d_val = s->size;
+             dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size;
              break;
            }
 
index cf174f8675deed56e1e95ae14dc95d5514621eb3..a39e1c9bd92ed34a4e1221afbc0ad2d82ebfa576 100644 (file)
@@ -3754,8 +3754,7 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
              break;
 
            case DT_PLTRELSZ:
-             s = htab->elf.srelplt;
-             dyn.d_un.d_val = s->size;
+             dyn.d_un.d_val = htab->elf.srelplt->size + htab->elf.irelplt->size;
              break;
 
            case DT_RELASZ:
@@ -3766,8 +3765,7 @@ 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.  */
-             s = htab->elf.srelplt;
-             dyn.d_un.d_val -= s->size;
+             dyn.d_un.d_val -= htab->elf.srelplt->size + htab->elf.irelplt->size;
              break;
            }