Skip to content

Commit

Permalink
Only provide non-default symbols in libpthread for vfork
Browse files Browse the repository at this point in the history
	* nptl/pt-vfork.c (vfork_resolve): Rename from vfork_ifunc.
	(vfork, __vfork): Define via compat_symbol.
  • Loading branch information
Richard Henderson committed May 24, 2014
1 parent 8820e3a commit 900e445
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
2014-05-23 Richard Henderson <rth@twiddle.net>

* nptl/pt-vfork.c (vfork_resolve): Rename from vfork_ifunc.
(vfork, __vfork): Define via compat_symbol.

* nptl/pt-vfork.c: Error if !HAVE_IFUNC.
[!HAVE_IFUNC] (vfork_compat): Remove.
[!HAVE_IFUNC] (DEFINE_VFORK): Remove.
Expand Down
16 changes: 9 additions & 7 deletions nptl/pt-vfork.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,30 +46,32 @@

extern __typeof (vfork) __libc_vfork; /* Defined in libc. */

attribute_hidden __attribute__ ((used))
__typeof (vfork) *
vfork_ifunc (void)
static __typeof (vfork) *
__attribute__ ((used))
vfork_resolve (void)
{
return &__libc_vfork;
}

# ifdef HAVE_ASM_SET_DIRECTIVE
# define DEFINE_VFORK(name) \
asm (".set " #name ", vfork_ifunc\n" \
asm (".set " #name ", vfork_resolve\n" \
".globl " #name "\n" \
".type " #name ", %gnu_indirect_function");
# else
# define DEFINE_VFORK(name) \
asm (#name " = vfork_ifunc\n" \
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)
DEFINE_VFORK (vfork)
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)
DEFINE_VFORK (__vfork)
DEFINE_VFORK (__vfork_ifunc)
compat_symbol (libpthread, __vfork_ifunc, __vfork, GLIBC_2_1_2);
#endif

0 comments on commit 900e445

Please sign in to comment.