Skip to content

Commit

Permalink
Only support ifunc in nptl/pt-vfork.c
Browse files Browse the repository at this point in the history
	* nptl/pt-vfork.c: Error if !HAVE_IFUNC.
	[!HAVE_IFUNC] (vfork_compat): Remove.
	[!HAVE_IFUNC] (DEFINE_VFORK): Remove.
  • Loading branch information
Richard Henderson committed May 24, 2014
1 parent e59252a commit 8820e3a
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
6 changes: 6 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2014-05-23 Richard Henderson <rth@twiddle.net>

* nptl/pt-vfork.c: Error if !HAVE_IFUNC.
[!HAVE_IFUNC] (vfork_compat): Remove.
[!HAVE_IFUNC] (DEFINE_VFORK): Remove.

2014-05-23 Joseph Myers <joseph@codesourcery.com>

[BZ #16978]
Expand Down
36 changes: 17 additions & 19 deletions nptl/pt-vfork.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,43 +28,41 @@
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)
{
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

Expand Down

0 comments on commit 8820e3a

Please sign in to comment.