]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Use libc_ifunc macro for vfork in libpthread.
authorStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 7 Oct 2016 07:56:47 +0000 (09:56 +0200)
committerStefan Liebler <stli@linux.vnet.ibm.com>
Fri, 7 Oct 2016 08:12:48 +0000 (10:12 +0200)
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.

ChangeLog
nptl/pt-vfork.c

index 4adcebd6908ed861a8518b059b5457890120a5f4..fd0ef40dfb4571b448ba1988f49e7e535ce3038c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2016-10-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
+
+       * nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro.
+
 2016-10-07  Stefan Liebler  <stli@linux.vnet.ibm.com>
 
        * nptl/pt-system.c (system_ifunc): Use libc_ifunc macro.
index 8f4be0c4b3b804c8fa2bf789a28a43ae5e1c38c3..563e3ec12fbf556d3466c8fab528b687030196a2 100644 (file)
 
 extern __typeof (vfork) __libc_vfork;   /* Defined in libc.  */
 
-static __typeof (vfork) *
-__attribute__ ((used))
-vfork_resolve (void)
-{
-  return &__libc_vfork;
-}
+# undef INIT_ARCH
+# 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