This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 7/8] Use libc_ifunc macro for vfork in libpthread.
- From: Stefan Liebler <stli at linux dot vnet dot ibm dot com>
- To: libc-alpha at sourceware dot org
- Cc: stli at linux dot vnet dot ibm dot com, joseph at codesourcery dot com, carlos at redhat dot com, munroesj at linux dot vnet dot ibm dot com
- Date: Thu, 23 Jun 2016 13:55:51 +0200
- Subject: [PATCH 7/8] Use libc_ifunc macro for vfork in libpthread.
- Authentication-results: sourceware.org; auth=none
- References: <1466682952-6301-1-git-send-email-stli at linux dot vnet dot ibm dot com>
This patch uses the libc_ifunc macro to create already existing ifunc functions
vfork_ifunc and __vfork_ifunc if HAVE_IFUNC is defined.
ChangeLog:
* nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro.
---
nptl/pt-vfork.c | 21 ++++-----------------
1 file changed, 4 insertions(+), 17 deletions(-)
diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c
index 8f4be0c..6258835 100644
--- a/nptl/pt-vfork.c
+++ b/nptl/pt-vfork.c
@@ -46,32 +46,19 @@
extern __typeof (vfork) __libc_vfork; /* Defined in libc. */
-static __typeof (vfork) *
-__attribute__ ((used))
-vfork_resolve (void)
-{
- return &__libc_vfork;
-}
+# define INIT_ARCH()
+# define DEFINE_VFORK(name) libc_ifunc (name, &__libc_vfork)
-# ifdef HAVE_ASM_SET_DIRECTIVE
-# define DEFINE_VFORK(name) \
- asm (".set " #name ", vfork_resolve\n" \
- ".globl " #name "\n" \
- ".type " #name ", %gnu_indirect_function");
-# else
-# define DEFINE_VFORK(name) \
- asm (#name " = vfork_resolve\n" \
- ".globl " #name "\n" \
- ".type " #name ", %gnu_indirect_function");
-# endif
#endif
#if SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20)
+extern __typeof(vfork) vfork_ifunc;
DEFINE_VFORK (vfork_ifunc)
compat_symbol (libpthread, vfork_ifunc, vfork, GLIBC_2_0);
#endif
#if SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20)
+extern __typeof(vfork) __vfork_ifunc;
DEFINE_VFORK (__vfork_ifunc)
compat_symbol (libpthread, __vfork_ifunc, __vfork, GLIBC_2_1_2);
#endif
--
2.3.0