Use libc_ifunc macro for siglongjmp, longjmp in libpthread.

This patch uses the libc_ifunc macro to create already existing ifunc functions
longjmp_ifunc, siglongjmp_ifunc if HAVE_IFUNC is defined.
The s390 pt-longjmp.c includes the common pt-longjmp.c and uses strong_alias
to create the longjmp, siglongjmp symbols for glibc version 2.19.

ChangeLog:

	* nptl/pt-longjmp.c (DEFINE_LONGJMP): Use libc_ifunc macro.
	* sysdeps/unix/sysv/linux/s390/pt-longjmp.c (longjmp, siglongjmp):
	Use strong_alias to create symbols for glibc verison 2.19.
This commit is contained in:
Stefan Liebler 2016-10-07 09:56:48 +02:00
parent 051f8be7c9
commit 314ba75e4a
3 changed files with 14 additions and 20 deletions

View File

@ -1,3 +1,9 @@
2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
* nptl/pt-longjmp.c (DEFINE_LONGJMP): Use libc_ifunc macro.
* sysdeps/unix/sysv/linux/s390/pt-longjmp.c (longjmp, siglongjmp):
Use strong_alias to create symbols for glibc verison 2.19.
2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com> 2016-10-07 Stefan Liebler <stli@linux.vnet.ibm.com>
* nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro. * nptl/pt-vfork.c (DEFINE_VFORK): Use libc_ifunc macro.

View File

@ -32,24 +32,12 @@
# if HAVE_IFUNC # if HAVE_IFUNC
static __typeof (longjmp) * # undef INIT_ARCH
__attribute__ ((used)) # define INIT_ARCH()
longjmp_resolve (void) # define DEFINE_LONGJMP(name) libc_ifunc (name, &__libc_longjmp)
{
return &__libc_longjmp;
}
# ifdef HAVE_ASM_SET_DIRECTIVE extern __typeof(longjmp) longjmp_ifunc;
# define DEFINE_LONGJMP(name) \ extern __typeof(siglongjmp) siglongjmp_ifunc;
asm (".set " #name ", longjmp_resolve\n" \
".globl " #name "\n" \
".type " #name ", %gnu_indirect_function");
# else
# define DEFINE_LONGJMP(name) \
asm (#name " = longjmp_resolve\n" \
".globl " #name "\n" \
".type " #name ", %gnu_indirect_function");
# endif
# else /* !HAVE_IFUNC */ # else /* !HAVE_IFUNC */
@ -66,7 +54,7 @@ longjmp_compat (jmp_buf env, int val)
DEFINE_LONGJMP (longjmp_ifunc) DEFINE_LONGJMP (longjmp_ifunc)
compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0); compat_symbol (libpthread, longjmp_ifunc, longjmp, GLIBC_2_0);
DEFINE_LONGJMP (siglongjmp_ifunc) strong_alias (longjmp_ifunc, siglongjmp_ifunc)
compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0); compat_symbol (libpthread, siglongjmp_ifunc, siglongjmp, GLIBC_2_0);
#endif #endif

View File

@ -26,8 +26,8 @@
/* In glibc release 2.19 new versions of longjmp-functions were introduced, /* In glibc release 2.19 new versions of longjmp-functions were introduced,
but were reverted before 2.20. Thus both versions are the same function. */ but were reverted before 2.20. Thus both versions are the same function. */
DEFINE_LONGJMP (__v2longjmp) strong_alias (longjmp_ifunc, __v2longjmp)
compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19); compat_symbol (libpthread, __v2longjmp, longjmp, GLIBC_2_19);
DEFINE_LONGJMP (__v2siglongjmp) strong_alias (siglongjmp_ifunc, __v2siglongjmp)
compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19); compat_symbol (libpthread, __v2siglongjmp, siglongjmp, GLIBC_2_19);
#endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */ #endif /* SHLIB_COMPAT (libpthread, GLIBC_2_19, GLIBC_2_20)) */