about summary refs log tree commit diff
path: root/nptl/pt-vfork.c
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2014-05-23 15:24:20 -0700
committerRichard Henderson <rth@twiddle.net>2014-05-23 21:33:05 -0700
commit8820e3acc3bb95b9b0921fe0c0711aae19f1da94 (patch)
treefbe1ffe4282f8f71785e675e778b07c975790a14 /nptl/pt-vfork.c
parente59252a58edad4bf74a094e22a70811d5585c60f (diff)
downloadglibc-8820e3acc3bb95b9b0921fe0c0711aae19f1da94.tar.gz
glibc-8820e3acc3bb95b9b0921fe0c0711aae19f1da94.tar.xz
glibc-8820e3acc3bb95b9b0921fe0c0711aae19f1da94.zip
Only support ifunc in nptl/pt-vfork.c
	* nptl/pt-vfork.c: Error if !HAVE_IFUNC.
	[!HAVE_IFUNC] (vfork_compat): Remove.
	[!HAVE_IFUNC] (DEFINE_VFORK): Remove.
Diffstat (limited to 'nptl/pt-vfork.c')
-rw-r--r--nptl/pt-vfork.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/nptl/pt-vfork.c b/nptl/pt-vfork.c
index 81d1b7195b..eaffe48f53 100644
--- a/nptl/pt-vfork.c
+++ b/nptl/pt-vfork.c
@@ -28,13 +28,24 @@
    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 the architecture can assume all supported versions of gcc will
+   produce a tail-call to __libc_vfork, consider including the version
+   in sysdeps/unix/sysv/linux/aarch64/pt-vfork.c.  */
+
+#if !HAVE_IFUNC
+# error "must write pt-vfork for this machine or get IFUNC support"
+#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 +53,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