[PATCH] powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]

Adhemerval Zanella-2
This patch adds the missing bits for powerpc and fixes both
tst-ifunc-fault-lazy and tst-ifunc-fault-bindnow failures on
powerpc-linux-gnu.

Checked on powerpc-linux-gnu and powerpc-linux-gnu-power4.
---
 sysdeps/powerpc/powerpc32/dl-machine.c | 5 +++--
 sysdeps/powerpc/powerpc32/dl-machine.h | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/sysdeps/powerpc/powerpc32/dl-machine.c b/sysdeps/powerpc/powerpc32/dl-machine.c
index d3ce2c17a9..a90cbc1ae3 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.c
+++ b/sysdeps/powerpc/powerpc32/dl-machine.c
@@ -414,7 +414,7 @@ __process_machine_rela (struct link_map *map,
  const Elf32_Sym *refsym,
  Elf32_Addr *const reloc_addr,
  Elf32_Addr const finaladdr,
- int rinfo)
+ int rinfo, bool skip_ifunc)
 {
   union unaligned
     {
@@ -434,7 +434,8 @@ __process_machine_rela (struct link_map *map,
       return;
 
     case R_PPC_IRELATIVE:
-      *reloc_addr = ((Elf32_Addr (*) (void)) finaladdr) ();
+      if (__glibc_likely (!skip_ifunc))
+ *reloc_addr = ((Elf32_Addr (*) (void)) finaladdr) ();
       return;
 
     case R_PPC_UADDR32:
diff --git a/sysdeps/powerpc/powerpc32/dl-machine.h b/sysdeps/powerpc/powerpc32/dl-machine.h
index 528690107b..4b1265282e 100644
--- a/sysdeps/powerpc/powerpc32/dl-machine.h
+++ b/sysdeps/powerpc/powerpc32/dl-machine.h
@@ -273,7 +273,8 @@ extern void __process_machine_rela (struct link_map *map,
     const Elf32_Sym *refsym,
     Elf32_Addr *const reloc_addr,
     Elf32_Addr finaladdr,
-    int rinfo) attribute_hidden;
+    int rinfo, bool skip_ifunc)
+  attribute_hidden;
 
 /* Call _dl_signal_error when a resolved value overflows a relocated area.  */
 extern void _dl_reloc_overflow (struct link_map *map,
@@ -436,7 +437,7 @@ elf_machine_rela (struct link_map *map, const Elf32_Rela *reloc,
 
     default:
       __process_machine_rela (map, reloc, sym_map, sym, refsym,
-      reloc_addr, value, r_type);
+      reloc_addr, value, r_type, skip_ifunc);
     }
 }
 
--
2.17.1

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]

Florian Weimer-5
* Adhemerval Zanella:

> This patch adds the missing bits for powerpc and fixes both
> tst-ifunc-fault-lazy and tst-ifunc-fault-bindnow failures on
> powerpc-linux-gnu.

Thanks.  Patch looks good.

Florian

Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] powerpc: Do not run IFUNC resolvers for LD_DEBUG=unused [BZ #24214]

Tulio Magno Quites Machado Filho-3
In reply to this post by Adhemerval Zanella-2
Adhemerval Zanella <[hidden email]> writes:

> This patch adds the missing bits for powerpc and fixes both
> tst-ifunc-fault-lazy and tst-ifunc-fault-bindnow failures on
> powerpc-linux-gnu.
>
> Checked on powerpc-linux-gnu and powerpc-linux-gnu-power4.

Reviewed-by: Tulio Magno Quites Machado Filho <[hidden email]>

Thanks!

--
Tulio Magno