clarify the purpose of this project
[nyanglibc.git] / debug / ____longjmp_chk.shared.s
blobfce1ca1ea1de55f0637b5184a8a417ed0f947054
1 .section .rodata.str1.1,"aMS",@progbits,1
2 .type longjmp_msg,@object
3 longjmp_msg:
4 .string "longjmp causes uninitialized stack frame"
5 .size longjmp_msg, .-longjmp_msg
6 .text
7 .globl ____longjmp_chk
8 .type ____longjmp_chk,@function
9 .align 1<<4
10 ____longjmp_chk:
11 mov (6*8)(%rdi), %r8
12 mov (1*8)(%rdi),%r9
13 mov (7*8)(%rdi), %rdx
14 ror $2*8 +1, %r8; xor %fs:48, %r8
15 ror $2*8 +1, %r9; xor %fs:48, %r9
16 ror $2*8 +1, %rdx; xor %fs:48, %rdx
17 cmp %r8, %rsp
18 jbe .Lok
19 movq %rdi, %r10
20 movl %esi, %ebx
21 xorl %edi, %edi
22 lea -24(%rsp), %rsi
23 movl $131, %eax
24 syscall
25 testl %eax, %eax
26 jne .Lok2
27 testl $1, (-24 + 8)(%rsp)
28 jz .Lfail
29 mov (-24 + 0)(%rsp), %rax
30 add (-24 + 16)(%rsp), %rax
31 sub %r8, %rax
32 cmp (-24 + 16)(%rsp), %rax
33 jae .Lok2
34 .Lfail: sub $8, %rsp
35 lea longjmp_msg(%rip), %rdi
36 call __GI___fortify_fail
37 nop
38 .Lok2: movq %r10, %rdi
39 movl %ebx, %esi
40 .Lok:
42 movq (0*8)(%rdi), %rbx
43 movq (2*8)(%rdi), %r12
44 movq (3*8)(%rdi), %r13
45 movq (4*8)(%rdi), %r14
46 movq (5*8)(%rdi), %r15
47 movl %esi, %eax
48 mov %r8, %rsp
49 movq %r9,%rbp
51 jmpq *%rdx
52 .size ____longjmp_chk,.-____longjmp_chk