S/390: ifunc: Fix for undefined ifunc symbols.
authorAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Mon, 12 Oct 2015 15:33:28 +0000 (17:33 +0200)
committerAndreas Krebbel <krebbel@linux.vnet.ibm.com>
Thu, 22 Oct 2015 08:02:38 +0000 (10:02 +0200)
bfd/ChangeLog:

* elf32-s390.c (elf_s390_finish_dynamic_symbol): Call
elf_s390_finish_ifunc_symbol only for actually defined symbols.
* elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.

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

index 6eec6650a1bc08b2e25ad8a172a4b918a1aa335d..44dd4d245878302875170c111787233db616a04e 100644 (file)
@@ -1,3 +1,9 @@
+2015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
+
+       * elf32-s390.c (elf_s390_finish_dynamic_symbol): Call
+       elf_s390_finish_ifunc_symbol only for actually defined symbols.
+       * elf64-s390.c (elf_s390_finish_dynamic_symbol): Likewise.
+
 2015-10-22  Andreas Krebbel  <krebbel@linux.vnet.ibm.com>
 
        * elf-s390-common.c (s390_elf_allocate_ifunc_dyn_relocs): Remove
index 509d8f9d198e357d1ed8a90c999f1939ec3bb7e2..85ac2982252bc3783a46b002a7db1e6c838bf866 100644 (file)
@@ -3554,16 +3554,15 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
 
       /* This symbol has an entry in the procedure linkage table.  Set
         it up.  */
-      if (s390_is_ifunc_symbol_p (h))
+      if (s390_is_ifunc_symbol_p (h) && h->def_regular)
        {
-         /* If we can resolve the IFUNC symbol locally we generate an
-            IRELATIVE reloc.  */
-         elf_s390_finish_ifunc_symbol (output_bfd, info, h, htab, h->plt.offset,
-                                       eh->ifunc_resolver_address +
-                                       eh->ifunc_resolver_section->output_offset +
-                                       eh->ifunc_resolver_section->output_section->vma);
-         /* Fallthrough.  Handling of explicit GOT slots of IFUNC
-            symbols is below.  */
+         elf_s390_finish_ifunc_symbol (output_bfd, info, h,
+           htab, h->plt.offset,
+           eh->ifunc_resolver_address +
+           eh->ifunc_resolver_section->output_offset +
+           eh->ifunc_resolver_section->output_section->vma);
+         /* Do not return yet.  Handling of explicit GOT slots of
+            IFUNC symbols is below.  */
        }
       else
        {
index d988b121c318d6de25fd5b808ef9ce51bb630694..1add8d50100a3af6fb9ad43cb433b3c52b86fad6 100644 (file)
@@ -3416,17 +3416,16 @@ elf_s390_finish_dynamic_symbol (bfd *output_bfd,
 
       /* This symbol has an entry in the procedure linkage table.  Set
         it up.  */
-      if (s390_is_ifunc_symbol_p (h))
+      if (s390_is_ifunc_symbol_p (h) && h->def_regular)
        {
-         /* If we can resolve the IFUNC symbol locally we generate an
-            IRELATIVE reloc.  */
-         elf_s390_finish_ifunc_symbol (output_bfd, info, h, htab, h->plt.offset,
-                                       eh->ifunc_resolver_address +
-                                       eh->ifunc_resolver_section->output_offset +
-                                       eh->ifunc_resolver_section->output_section->vma);
-                                ;
-         /* Fallthrough.  Handling of explicit GOT slots of IFUNC
-            symbols is below.  */
+         elf_s390_finish_ifunc_symbol (output_bfd, info, h,
+           htab, h->plt.offset,
+           eh->ifunc_resolver_address +
+           eh->ifunc_resolver_section->output_offset +
+           eh->ifunc_resolver_section->output_section->vma);
+
+         /* Do not return yet.  Handling of explicit GOT slots of
+            IFUNC symbols is below.  */
        }
       else
        {