diff mbox

[v3,7/9] Use libc_ifunc macro for system in libpthread.

Message ID 1472047472-30307-7-git-send-email-stli@linux.vnet.ibm.com
State New
Headers show

Commit Message

Stefan Liebler Aug. 24, 2016, 2:04 p.m. UTC
This patch uses the libc_ifunc macro to create already existing ifunc function
system_ifunc if HAVE_IFUNC is defined.

ChangeLog:

	* nptl/pt-system.c (system_ifunc): Use libc_ifunc macro.
---
 nptl/pt-system.c | 19 ++++---------------
 1 file changed, 4 insertions(+), 15 deletions(-)

Comments

Florian Weimer Aug. 30, 2016, 12:39 p.m. UTC | #1
On 08/24/2016 04:04 PM, Stefan Liebler wrote:
> 	* nptl/pt-system.c (system_ifunc): Use libc_ifunc macro.

Likewise, looks okay.

Thanks,
Florian
diff mbox

Patch

diff --git a/nptl/pt-system.c b/nptl/pt-system.c
index 56f2a89..cc415da 100644
--- a/nptl/pt-system.c
+++ b/nptl/pt-system.c
@@ -32,21 +32,10 @@ 
 
 # if HAVE_IFUNC
 
-static __typeof (system) *
-__attribute__ ((used))
-system_resolve (void)
-{
-  return &__libc_system;
-}
-
-asm (".globl system_ifunc\n"
-     ".type system_ifunc, %gnu_indirect_function");
-
-#  ifdef HAVE_ASM_SET_DIRECTIVE
-asm (".set system_ifunc, system_resolve");
-#  else
-asm ("system_ifunc = system_resolve");
-#  endif
+extern __typeof(system) system_ifunc;
+#  undef INIT_ARCH
+#  define INIT_ARCH()
+libc_ifunc (system_ifunc, &__libc_system)
 
 # else  /* !HAVE_IFUNC */