about summary refs log tree commit diff
path: root/sysdeps/unix/sysv
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2015-09-18 12:22:36 -0700
committerH.J. Lu <hjl.tools@gmail.com>2015-09-18 12:22:47 -0700
commit94afa0a5f38315a44cf4ec36d3027e103e16cfc0 (patch)
treed298cc8a5172238fcdbe758addceba1dc3639d48 /sysdeps/unix/sysv
parent3ee578690f35942f41926cc2d98e25b3d0d08c71 (diff)
downloadglibc-94afa0a5f38315a44cf4ec36d3027e103e16cfc0.tar.gz
glibc-94afa0a5f38315a44cf4ec36d3027e103e16cfc0.tar.xz
glibc-94afa0a5f38315a44cf4ec36d3027e103e16cfc0.zip
Use __libc_ptf_call in _longjmp_unwind
Use __libc_ptf_call in _longjmp_unwind to avoid duplicated logic.  On
x86-64, I got

jmp-unwind.os:
_longjmp_unwind:
	movl	__libc_pthread_functions_init(%rip), %eax
	testl	%eax, %eax
	jne	.L4
	rep ret
.L4:
	movq	304+__libc_pthread_functions(%rip), %rax
	movq	%rsp, %rsi
	ror $2*8+1, %rax
	xor %fs:48, %rax
	jmp	*%rax

jmp-unwind.o:

_longjmp_unwind:
	movl	$__pthread_cleanup_upto, %eax
	testq	%rax, %rax
	je	.L1
	movq	%rsp, %rsi
	jmp	__pthread_cleanup_upto
.L1:
	rep ret

	* sysdeps/nptl/jmp-unwind.c: Include <libc-lock.h> instead of
	<nptl/pthreadP.h>.
	(_longjmp_unwind): Use __libc_ptf_call.
	* sysdeps/unix/sysv/linux/s390/jmp-unwind.c: Likewise.
Diffstat (limited to 'sysdeps/unix/sysv')
-rw-r--r--sysdeps/unix/sysv/linux/s390/jmp-unwind.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/sysdeps/unix/sysv/linux/s390/jmp-unwind.c b/sysdeps/unix/sysv/linux/s390/jmp-unwind.c
index 52fe1019f2..4b8ad28630 100644
--- a/sysdeps/unix/sysv/linux/s390/jmp-unwind.c
+++ b/sysdeps/unix/sysv/linux/s390/jmp-unwind.c
@@ -18,7 +18,7 @@
 
 #include <setjmp.h>
 #include <stddef.h>
-#include <nptl/pthreadP.h>
+#include <libc-lock.h>
 
 extern void __pthread_cleanup_upto (__jmp_buf env, char *targetframe);
 #pragma weak __pthread_cleanup_upto
@@ -29,11 +29,5 @@ _longjmp_unwind (jmp_buf env, int val)
 {
   char local_var;
 
-#ifdef SHARED
-  if (__libc_pthread_functions_init)
-    PTHFCT_CALL (ptr___pthread_cleanup_upto, (env->__jmpbuf, &local_var));
-#else
-  if (__pthread_cleanup_upto != NULL)
-    __pthread_cleanup_upto (env->__jmpbuf, &local_var);
-#endif
+  __libc_ptf_call (__pthread_cleanup_upto, (env->__jmpbuf, &local_var), 0);
 }