]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commitdiff
PR23123, PowerPC32 ifunc regression
authorAlan Modra <amodra@gmail.com>
Fri, 27 Apr 2018 06:16:40 +0000 (15:46 +0930)
committerAlan Modra <amodra@gmail.com>
Fri, 27 Apr 2018 09:30:26 +0000 (19:00 +0930)
Two of the gcc ifunc tests fail for ppc32, due to my pr22374 fix being
a little too enthusiastic in trimming PLT entries.  ppc64 doesn't have
the same failures because ppc64_elf_check_relocs happens to set
needs_plt for any ifunc reloc.

PR 23123
PR 22374
* elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt
relocs for ifuncs.
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.

(cherry picked from commit 04383fd15b3b82d824df9c72e3ade88c43bfb5ac)

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

index ad41bbf8608fb4d12be1e780bc182dfc6e0c9c03..c54a5c0549bd88a97674d1971de2516141718d2f 100644 (file)
@@ -1,3 +1,11 @@
+2018-04-27  Alan Modra  <amodra@gmail.com>
+
+       PR 23123
+       PR 22374
+       * elf32-ppc.c (ppc_elf_adjust_dynamic_symbol): Don't drop plt
+       relocs for ifuncs.
+       * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Comment fixes.
+
 2018-02-09  H.J. Lu  <hongjiu.lu@intel.com>
 
        * elf32-i386.c (elf_i386_get_synthetic_symtab): Also handle
index 092b1ced8dde03e63ca9a1c5c989dba7628cc762..16ee60fb0ee4327db364d1f8e04d3462a02016c5 100644 (file)
@@ -5551,9 +5551,9 @@ ppc_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
              && !readonly_dynrelocs (h))
            {
              h->pointer_equality_needed = 0;
-             /* If we haven't seen a branch reloc then we don't need
-                a plt entry.  */
-             if (!h->needs_plt)
+             /* If we haven't seen a branch reloc and the symbol
+                isn't an ifunc then we don't need a plt entry.  */
+             if (!h->needs_plt && h->type != STT_GNU_IFUNC)
                h->plt.plist = NULL;
            }
          else if (!bfd_link_pic (info))
index 039294fd1cdceb30b5f3276e9b9d071679354cd4..8940d0aa5607490aa4aee646c56669e75b6eaa73 100644 (file)
@@ -7183,8 +7183,8 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
              if (!readonly_dynrelocs (h))
                {
                  h->pointer_equality_needed = 0;
-                 /* If we haven't seen a branch reloc then we don't need
-                    a plt entry.  */
+                 /* If we haven't seen a branch reloc and the symbol
+                    isn't an ifunc then we don't need a plt entry.  */
                  if (!h->needs_plt)
                    h->plt.plist = NULL;
                }
@@ -7200,8 +7200,8 @@ ppc64_elf_adjust_dynamic_symbol (struct bfd_link_info *info,
       else if (!h->needs_plt
               && !readonly_dynrelocs (h))
        {
-         /* If we haven't seen a branch reloc then we don't need a
-            plt entry.  */
+         /* If we haven't seen a branch reloc and the symbol isn't an
+            ifunc then we don't need a plt entry.  */
          h->plt.plist = NULL;
          h->pointer_equality_needed = 0;
          return TRUE;