PR19083 S/390: Fix garbage collection of some GOT relocs.
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 12 Oct 2015 08:21:51 +0000 (10:21 +0200)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 12 Oct 2015 08:22:49 +0000 (10:22 +0200)
bfd/ChangeLog:

2015-10-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>

PR ld/19083
* elf32-s390.c (elf_s390_gc_sweep_hook): Do not reduce got
refcount for relocs not really requiring a got slot.
* elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.

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

index 3e234b4105e1046ab4f1ea757c4562b75dd7fbdd..ce1089b6a3a3275fefaf42b4c3d0bbd96e517922 100644 (file)
@@ -1,3 +1,10 @@
+2015-10-12  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       PR ld/19083
+       * elf32-s390.c (elf_s390_gc_sweep_hook): Do not reduce got
+       refcount for relocs not really requiring a got slot.
+       * elf64-s390.c (elf_s390_gc_sweep_hook): Likewise.
+
 2015-10-11  John David Anglin  <danglin@gcc.gnu.org>
 
        * elf-hppa.h (elf_hppa_action_discarded): Ignore relocations in
index 2143ee1773d9683e6d8dd9bb4b139a6a1dbe30e7..dc2d80ff2e3cf1f79f74bbd6bd265047402b939d 100644 (file)
@@ -1527,6 +1527,12 @@ elf_s390_gc_sweep_hook (bfd *abfd,
            elf_s390_hash_table (info)->tls_ldm_got.refcount -= 1;
          break;
 
+       case R_390_GOTOFF16:
+       case R_390_GOTOFF32:
+       case R_390_GOTPC:
+       case R_390_GOTPCDBL:
+         break;
+
        case R_390_TLS_GD32:
        case R_390_TLS_IE32:
        case R_390_TLS_GOTIE12:
@@ -1537,10 +1543,6 @@ elf_s390_gc_sweep_hook (bfd *abfd,
        case R_390_GOT16:
        case R_390_GOT20:
        case R_390_GOT32:
-       case R_390_GOTOFF16:
-       case R_390_GOTOFF32:
-       case R_390_GOTPC:
-       case R_390_GOTPCDBL:
        case R_390_GOTENT:
          if (h != NULL)
            {
index 1c3769976e65b20b84bf1bf454f66ba0057de32a..7cc0489d84db76098add11234c60575b46d35aec 100644 (file)
@@ -1462,6 +1462,12 @@ elf_s390_gc_sweep_hook (bfd *abfd,
          if (htab->tls_ldm_got.refcount > 0)
            htab->tls_ldm_got.refcount -= 1;
          break;
+       case R_390_GOTOFF16:
+       case R_390_GOTOFF32:
+       case R_390_GOTOFF64:
+       case R_390_GOTPC:
+       case R_390_GOTPCDBL:
+         break;
 
        case R_390_TLS_GD64:
        case R_390_TLS_IE64:
@@ -1474,11 +1480,6 @@ elf_s390_gc_sweep_hook (bfd *abfd,
        case R_390_GOT20:
        case R_390_GOT32:
        case R_390_GOT64:
-       case R_390_GOTOFF16:
-       case R_390_GOTOFF32:
-       case R_390_GOTOFF64:
-       case R_390_GOTPC:
-       case R_390_GOTPCDBL:
        case R_390_GOTENT:
          if (h != NULL)
            {