]> git.ipfire.org Git - thirdparty/glibc.git/commit
Use __libc_ptf_call in _longjmp_unwind
authorH.J. Lu <hjl.tools@gmail.com>
Fri, 18 Sep 2015 19:22:36 +0000 (12:22 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Fri, 18 Sep 2015 19:22:47 +0000 (12:22 -0700)
commit94afa0a5f38315a44cf4ec36d3027e103e16cfc0
treed298cc8a5172238fcdbe758addceba1dc3639d48
parent3ee578690f35942f41926cc2d98e25b3d0d08c71
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.
ChangeLog
sysdeps/nptl/jmp-unwind.c
sysdeps/unix/sysv/linux/s390/jmp-unwind.c