mirror of
https://sourceware.org/git/glibc.git
synced 2025-01-09 02:40:08 +00:00
Merge branch 'master' of file:///net/myware66/home/drepper/gnu/libc
This commit is contained in:
commit
52ec0eb3db
@ -1,3 +1,12 @@
|
|||||||
|
2009-07-31 Ulrich Drepper <drepper@redhat.com>
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S (longjmp_msg): Yet
|
||||||
|
another rewrite. Much smaller and faster.
|
||||||
|
* sysdeps/unix/sysv/linux/i386/____longjmp_chk.S: Likewise.
|
||||||
|
|
||||||
|
* sysdeps/unix/sysv/linux/x86_64/____longjmp_chk.S (longjmp_msg): Get
|
||||||
|
ss_flags from the correct location.
|
||||||
|
|
||||||
2009-07-31 H.J. Lu <hongjiu.lu@intel.com>
|
2009-07-31 H.J. Lu <hongjiu.lu@intel.com>
|
||||||
|
|
||||||
* sysdeps/i386/i686/Makefile (sysdep_routines): Add cacheinfo.
|
* sysdeps/i386/i686/Makefile (sysdep_routines): Add cacheinfo.
|
||||||
|
@ -58,8 +58,6 @@ ENTRY (____longjmp_chk)
|
|||||||
PTR_DEMANGLE (%edx)
|
PTR_DEMANGLE (%edx)
|
||||||
PTR_DEMANGLE (%edi)
|
PTR_DEMANGLE (%edi)
|
||||||
|
|
||||||
pushl $0
|
|
||||||
cfi_adjust_cfa_offset(4)
|
|
||||||
cmpl %edi, %esp
|
cmpl %edi, %esp
|
||||||
jbe .Lok
|
jbe .Lok
|
||||||
|
|
||||||
@ -69,15 +67,25 @@ ENTRY (____longjmp_chk)
|
|||||||
movl %esp, %ecx
|
movl %esp, %ecx
|
||||||
movl $__NR_sigaltstack, %eax
|
movl $__NR_sigaltstack, %eax
|
||||||
ENTER_KERNEL
|
ENTER_KERNEL
|
||||||
movl 4(%esp), %ebx
|
/* Without working sigaltstack we cannot perform the test. */
|
||||||
addl $12, %esp
|
test %eax, %eax
|
||||||
|
jne .Lok2
|
||||||
|
testl $1, 4(%esp)
|
||||||
|
jz .Lfail
|
||||||
|
|
||||||
|
movl (%esp), %eax
|
||||||
|
addl 8(%esp), %eax
|
||||||
|
subl %edi, %eax
|
||||||
|
cmpl 8(%esp), %eax
|
||||||
|
jae .Lok2
|
||||||
|
|
||||||
|
.Lfail: CALL_FAIL
|
||||||
|
|
||||||
|
.Lok2: addl $12, %esp
|
||||||
cfi_adjust_cfa_offset(-12)
|
cfi_adjust_cfa_offset(-12)
|
||||||
movl 8(%esp), %ecx
|
movl 4(%esp), %ecx
|
||||||
testl %eax, %eax
|
|
||||||
jne .Lok
|
.Lok: /* We add unwind information for the target here. */
|
||||||
andl $1, %ebx
|
|
||||||
movl %ebx, (%esp)
|
|
||||||
.Lok:
|
|
||||||
cfi_def_cfa(%ecx, 0)
|
cfi_def_cfa(%ecx, 0)
|
||||||
cfi_register(%eip, %edx)
|
cfi_register(%eip, %edx)
|
||||||
cfi_register(%esp, %edi)
|
cfi_register(%esp, %edi)
|
||||||
@ -86,15 +94,11 @@ ENTRY (____longjmp_chk)
|
|||||||
cfi_offset(%edi, JB_DI*4)
|
cfi_offset(%edi, JB_DI*4)
|
||||||
cfi_offset(%ebp, JB_BP*4)
|
cfi_offset(%ebp, JB_BP*4)
|
||||||
|
|
||||||
movl 12(%esp), %eax /* Second argument is return value. */
|
movl 8(%esp), %eax /* Second argument is return value. */
|
||||||
xchgl %edi, %esp
|
movl %edi, %esp
|
||||||
cfi_restore(%edi)
|
|
||||||
|
|
||||||
cmpl %esp, %edi
|
|
||||||
jnbe .Lcheck
|
|
||||||
|
|
||||||
/* Restore registers. */
|
/* Restore registers. */
|
||||||
.Lout: movl (JB_BX*4)(%ecx), %ebx
|
movl (JB_BX*4)(%ecx), %ebx
|
||||||
movl (JB_SI*4)(%ecx), %esi
|
movl (JB_SI*4)(%ecx), %esi
|
||||||
movl (JB_DI*4)(%ecx), %edi
|
movl (JB_DI*4)(%ecx), %edi
|
||||||
movl (JB_BP*4)(%ecx), %ebp
|
movl (JB_BP*4)(%ecx), %ebp
|
||||||
@ -105,39 +109,4 @@ ENTRY (____longjmp_chk)
|
|||||||
|
|
||||||
/* Jump to saved PC. */
|
/* Jump to saved PC. */
|
||||||
jmp *%edx
|
jmp *%edx
|
||||||
|
|
||||||
cfi_def_cfa(%ecx, 0)
|
|
||||||
cfi_register(%eip, %edx)
|
|
||||||
cfi_offset(%ebx, JB_BX*4)
|
|
||||||
cfi_offset(%esi, JB_SI*4)
|
|
||||||
cfi_offset(%edi, JB_DI*4)
|
|
||||||
cfi_offset(%ebp, JB_BP*4)
|
|
||||||
|
|
||||||
.Lcheck:
|
|
||||||
cmpl $0, (%edi)
|
|
||||||
je .Lfail
|
|
||||||
|
|
||||||
subl $12, %esp
|
|
||||||
cfi_adjust_cfa_offset(12)
|
|
||||||
xorl %ebx, %ebx
|
|
||||||
movl %esp, %ecx
|
|
||||||
movl $__NR_sigaltstack, %eax
|
|
||||||
ENTER_KERNEL
|
|
||||||
testl $1, 4(%esp)
|
|
||||||
leal 12(%esp), %esp
|
|
||||||
movl 8(%edi), %ecx
|
|
||||||
movl 12(%edi), %eax
|
|
||||||
cfi_adjust_cfa_offset(-12)
|
|
||||||
je .Lout
|
|
||||||
|
|
||||||
.Lfail: xchgl %edi, %esp
|
|
||||||
cfi_def_cfa(%esp, 8)
|
|
||||||
cfi_restore(%esp)
|
|
||||||
cfi_restore(%ebx)
|
|
||||||
cfi_restore(%esi)
|
|
||||||
cfi_undefined(%edi)
|
|
||||||
cfi_restore(%ebp)
|
|
||||||
|
|
||||||
CALL_FAIL
|
|
||||||
hlt
|
|
||||||
END (____longjmp_chk)
|
END (____longjmp_chk)
|
||||||
|
@ -58,31 +58,36 @@ ENTRY(____longjmp_chk)
|
|||||||
PTR_DEMANGLE (%rdx)
|
PTR_DEMANGLE (%rdx)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
cmpq %r8, %rsp
|
||||||
|
jbe .Lok
|
||||||
|
|
||||||
/* Save function parameters. */
|
/* Save function parameters. */
|
||||||
movq %rdi, %r10
|
movq %rdi, %r10
|
||||||
movl %esi, %ecx
|
movl %esi, %ecx
|
||||||
|
|
||||||
xorl %eax, %eax
|
|
||||||
cmpq %r8, %rsp
|
|
||||||
jbe .Lok
|
|
||||||
|
|
||||||
subq $24, %rsp
|
|
||||||
cfi_adjust_cfa_offset(24)
|
|
||||||
xorl %edi, %edi
|
xorl %edi, %edi
|
||||||
movq %rsp, %rsi
|
leaq -24(%rsp), %rsi
|
||||||
movl $__NR_sigaltstack, %eax
|
movl $__NR_sigaltstack, %eax
|
||||||
syscall
|
syscall
|
||||||
|
/* Without working sigaltstack we cannot perform the test. */
|
||||||
testl %eax, %eax
|
testl %eax, %eax
|
||||||
movl $0, %eax
|
jne .Lok2
|
||||||
leaq 24(%rsp), %rsp
|
testl $1, -16(%rsp)
|
||||||
cfi_adjust_cfa_offset(-24)
|
jz .Lfail
|
||||||
jne .Lok
|
|
||||||
movl 8(%rsp), %eax
|
|
||||||
andl $1, %eax
|
|
||||||
|
|
||||||
.Lok:
|
movq -24(%rsp), %rax
|
||||||
/* We add unwind information for the target here. */
|
addq -8(%rsp), %rax
|
||||||
cfi_def_cfa(%r10, 0)
|
subq %r8, %rax
|
||||||
|
cmpq -8(%rsp), %rax
|
||||||
|
jae .Lok2
|
||||||
|
|
||||||
|
.Lfail: CALL_FAIL
|
||||||
|
|
||||||
|
.Lok2: movq %r10, %rdi
|
||||||
|
movl %ecx, %esi
|
||||||
|
|
||||||
|
.Lok: /* We add unwind information for the target here. */
|
||||||
|
cfi_def_cfa(%rdi, 0)
|
||||||
cfi_register(%rsp,%r8)
|
cfi_register(%rsp,%r8)
|
||||||
cfi_register(%rbp,%r9)
|
cfi_register(%rbp,%r9)
|
||||||
cfi_register(%rip,%rdx)
|
cfi_register(%rip,%rdx)
|
||||||
@ -91,55 +96,14 @@ ENTRY(____longjmp_chk)
|
|||||||
cfi_offset(%r13,JB_R13*8)
|
cfi_offset(%r13,JB_R13*8)
|
||||||
cfi_offset(%r14,JB_R14*8)
|
cfi_offset(%r14,JB_R14*8)
|
||||||
cfi_offset(%r15,JB_R15*8)
|
cfi_offset(%r15,JB_R15*8)
|
||||||
|
movq (JB_RBX*8)(%rdi),%rbx
|
||||||
xchgq %r8, %rsp
|
movq (JB_R12*8)(%rdi),%r12
|
||||||
cfi_restore(%rsp)
|
movq (JB_R13*8)(%rdi),%r13
|
||||||
xchgq %r9, %rbp
|
movq (JB_R14*8)(%rdi),%r14
|
||||||
cfi_restore(%rbp)
|
movq (JB_R15*8)(%rdi),%r15
|
||||||
|
|
||||||
movq (JB_RBX*8)(%r10),%rbx
|
|
||||||
movq (JB_R12*8)(%r10),%r12
|
|
||||||
movq (JB_R13*8)(%r10),%r13
|
|
||||||
movq (JB_R14*8)(%r10),%r14
|
|
||||||
movq (JB_R15*8)(%r10),%r15
|
|
||||||
|
|
||||||
cmpq %rsp, %r8
|
|
||||||
jnbe .Lcheck
|
|
||||||
|
|
||||||
/* Set return value for setjmp. */
|
/* Set return value for setjmp. */
|
||||||
.Lout: movl %ecx, %eax
|
movl %esi, %eax
|
||||||
|
movq %r8,%rsp
|
||||||
|
movq %r9,%rbp
|
||||||
jmpq *%rdx
|
jmpq *%rdx
|
||||||
|
|
||||||
.Lcheck:
|
|
||||||
testl %eax, %eax
|
|
||||||
je .Lfail
|
|
||||||
|
|
||||||
subq $24, %rsp
|
|
||||||
cfi_adjust_cfa_offset(24)
|
|
||||||
xorl %edi, %edi
|
|
||||||
movq %rsp, %rsi
|
|
||||||
movl $__NR_sigaltstack, %eax
|
|
||||||
syscall
|
|
||||||
addq $24, %rsp
|
|
||||||
cfi_adjust_cfa_offset(-24)
|
|
||||||
testl $1, 8(%rsp)
|
|
||||||
je .Lout
|
|
||||||
|
|
||||||
.Lfail: xchgq %r8, %rsp
|
|
||||||
/* We want the stack trace to show that of the caller. */
|
|
||||||
cfi_def_cfa(%rsp, 8)
|
|
||||||
cfi_restore(%rsp)
|
|
||||||
cfi_register(%rbp, %r9)
|
|
||||||
cfi_restore(%rip)
|
|
||||||
cfi_restore(%rbx)
|
|
||||||
cfi_restore(%r12)
|
|
||||||
cfi_restore(%r13)
|
|
||||||
cfi_restore(%r14)
|
|
||||||
cfi_restore(%r15)
|
|
||||||
|
|
||||||
xchgq %r9, %rbp
|
|
||||||
cfi_restore(%rbp)
|
|
||||||
|
|
||||||
CALL_FAIL
|
|
||||||
hlt
|
|
||||||
END (BP_SYM (____longjmp_chk))
|
END (BP_SYM (____longjmp_chk))
|
||||||
|
Loading…
Reference in New Issue
Block a user