This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH 1/2] Only support ifunc in nptl/pt-vfork.c
- From: Richard Henderson <rth at twiddle dot net>
- To: libc-alpha at sourceware dot org
- Cc: roland at hack dot frob dot com
- Date: Fri, 23 May 2014 16:15:35 -0700
- Subject: [PATCH 1/2] Only support ifunc in nptl/pt-vfork.c
- Authentication-results: sourceware.org; auth=none
- References: <1400886936-16338-1-git-send-email-rth at twiddle dot net>
* nptl/pt-vfork.c: Error if !HAVE_IFUNC.
[!HAVE_IFUNC] (vfork_compat): Remove.
[!HAVE_IFUNC] (DEFINE_VFORK): Remove.
---
nptl/pt-vfork.c | 32 +++++++++++++-------------------
1 file changed, 13 insertions(+), 19 deletions(-)
diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c
index 81d1b71..8beb121 100644
--- a/nptl/pt-vfork.c
+++ b/nptl/pt-vfork.c
@@ -28,13 +28,20 @@
vfork symbols in libpthread.so; so we define them using IFUNC to
redirect to the libc function. */
+/* Note! If the architecture doesn't support IFUNC, then we need an
+ alternate target-specific mechanism to implement this. So we just
+ assume IFUNC here and require that the target override this file
+ if necessary. */
+
+#if !HAVE_IFUNC
+# error
+#endif
+
#if (SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_20) \
|| SHLIB_COMPAT (libpthread, GLIBC_2_1_2, GLIBC_2_20))
extern __typeof (vfork) __libc_vfork; /* Defined in libc. */
-# ifdef HAVE_IFUNC
-
attribute_hidden __attribute__ ((used))
__typeof (vfork) *
vfork_ifunc (void)
@@ -42,29 +49,16 @@ vfork_ifunc (void)
return &__libc_vfork;
}
-# ifdef HAVE_ASM_SET_DIRECTIVE
-# define DEFINE_VFORK(name) \
+# ifdef HAVE_ASM_SET_DIRECTIVE
+# define DEFINE_VFORK(name) \
asm (".set " #name ", vfork_ifunc\n" \
".globl " #name "\n" \
".type " #name ", %gnu_indirect_function");
-# else
-# define DEFINE_VFORK(name) \
+# else
+# define DEFINE_VFORK(name) \
asm (#name " = vfork_ifunc\n" \
".globl " #name "\n" \
".type " #name ", %gnu_indirect_function");
-# endif
-
-# else
-
-attribute_hidden
-pid_t
-vfork_compat (void)
-{
- return __libc_vfork ();
-}
-
-# define DEFINE_VFORK(name) weak_alias (vfork_compat, name)
-
# endif
#endif
--
1.9.0