]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
S/390: Fix claimfile failures
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Tue, 1 Aug 2017 13:15:38 +0000 (15:15 +0200)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Tue, 1 Aug 2017 13:15:38 +0000 (15:15 +0200)
This fixes a segfault when trying to access the local_plt field in the
s390 specific elf data althoug the underlaying object is a generic elf
object.

This fixes the following testsuite failures:

< FAIL: plugin claimfile replace symbol with source
< FAIL: plugin claimfile resolve symbol with source
< FAIL: plugin claimfile replace file with source
< FAIL: plugin set symbol visibility with source
< FAIL: plugin ignore lib with source
< FAIL: plugin claimfile replace lib with source
< FAIL: plugin 2 with source lib
< FAIL: load plugin 2 with source
< FAIL: plugin 3 with source lib
< FAIL: load plugin 3 with source

bfd/ChangeLog:

2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

Backport from mainline
2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

* elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
isn't the S/390 specific elf data.
* elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.

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

index 103334d34e096775eb75b7b30f55d8195ff0bc85..048bf141c9c4768616b4080b5e0fda5815e128c5 100644 (file)
@@ -1,3 +1,12 @@
+2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       Backport from mainline
+       2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       * elf32-s390.c (elf_s390_finish_dynamic_sections): Skip if it
+       isn't the S/390 specific elf data.
+       * elf64-s390.c (elf_s390_finish_dynamic_sections): Likewise.
+
 2017-08-01  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        Backport from mainline
index 8adf9e4784898aae791fe9bf32cf4ceac4d1f6fc..4aa3915cb2556a2d9328fd8e15237b2e6c7d3470 100644 (file)
@@ -4001,6 +4001,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
 
       symtab_hdr = &elf_symtab_hdr (ibfd);
 
+      if (!is_s390_elf (ibfd))
+       continue;
+
       local_plt = elf_s390_local_plt (ibfd);
       if (local_plt != NULL)
        for (i = 0; i < symtab_hdr->sh_info; i++)
index 4dfa007cc8bb658dc6ca38a7e41db007561671d7..d25c72b88a3f891f7a191515057a4eed3c1ea74e 100644 (file)
@@ -3814,6 +3814,9 @@ elf_s390_finish_dynamic_sections (bfd *output_bfd,
 
       symtab_hdr = &elf_symtab_hdr (ibfd);
 
+      if (!is_s390_elf (ibfd))
+       continue;
+
       local_plt = elf_s390_local_plt (ibfd);
       if (local_plt != NULL)
        for (i = 0; i < symtab_hdr->sh_info; i++)