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 07:42:32 +0000 (17:12 +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.

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

index fcfd9138cf7dfcf7157a87b3874064ff1ac8f225..54948758782067c0f0d1ea5ba7a8777a89c857c3 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-04-26  Pedro Alves  <palves@redhat.com>
 
        * elf64-ppc.c (ppc64_elf_get_synthetic_symtab): Don't consider
index 0438af4e2a741bd151b3c8c541c14a11215b838c..1200de8458228897fc73f2596417587eb3a91c99 100644 (file)
@@ -5899,9 +5899,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 9009768ebd8275b2713561ac6ac9dd0bd935c957..09377d102cebc845476a0b3e5dd33da51c381726 100644 (file)
@@ -7304,8 +7304,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;
                }
@@ -7321,8 +7321,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;
This page took 0.040499 seconds and 4 git commands to generate.