S/390: Fix ifunc missing runtime reloc
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 8 May 2017 17:10:42 +0000 (19:10 +0200)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 8 May 2017 17:43:20 +0000 (19:43 +0200)
This fixes a problem with a missing R_390_64 reloc against .data for a
function pointer to an ifunc function.

No regressions on s390x.

Pushed to mainline.

bfd/ChangeLog:

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

* elf-s390-common.c: Don't check non_got_ref flag.
* elf32-s390.c (elf_s390_relocate_section): Likewise.
* elf64-s390.c (elf_s390_relocate_section): Likewise.

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

index 157036532a8df5e65b3f39fcb6da18f08ad62578..8795fb9a0485521ba6106debb3fca542af76b2d1 100644 (file)
@@ -161,9 +161,7 @@ keep:
       h->type = STT_FUNC;
     }
 
-  /* We need dynamic relocation for STT_GNU_IFUNC symbol only when
-     there is a non-GOT reference in a shared object.  */
-  if (!bfd_link_pic (info) || !h->non_got_ref)
+  if (!bfd_link_pic (info))
     *head = NULL;
 
   /* Finally, allocate space.  */
index ddb6f5b255e7a2ba3e11249c54878c90dbbb676e..8a09a319abc094456ebd46835d4cefa760805c21 100644 (file)
@@ -2774,7 +2774,7 @@ elf_s390_relocate_section (bfd *output_bfd,
              && s390_is_ifunc_symbol_p (h)
              && h->def_regular)
            {
-             if (!bfd_link_pic (info) || !h->non_got_ref)
+             if (!bfd_link_pic (info))
                {
                  /* For a non-shared object STT_GNU_IFUNC symbol must
                     go through PLT.  */
index fbbf8d6e1def3f5435e73b890e8c1c613c910c3d..ca3541f583dc0c751c2f288d83c762cc76e3935d 100644 (file)
@@ -2737,10 +2737,11 @@ elf_s390_relocate_section (bfd *output_bfd,
              && s390_is_ifunc_symbol_p (h)
              && h->def_regular)
            {
-             if (!bfd_link_pic (info) || !h->non_got_ref)
+             if (!bfd_link_pic (info))
                {
-                 /* For a non-shared object STT_GNU_IFUNC symbol must
-                    go through PLT.  */
+                 /* For a non-shared object the symbol will not
+                    change.  Hence we can write the address of the
+                    target IPLT slot now.  */
                  relocation = (htab->elf.iplt->output_section->vma
                                + htab->elf.iplt->output_offset
                                + h ->plt.offset);
This page took 0.030635 seconds and 4 git commands to generate.