clarify the purpose of this project
[nyanglibc.git] / debug / strcat_chk.shared.s
blob59b732b31d60fec49c9be493d9307bc7600da159
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __strcat_chk
9 .type __strcat_chk, @function
10 __strcat_chk:
11 leaq (%rdi,%rdx), %r10
12 movq %rdi, %rcx
13 jmp .L3
14 .p2align 4,,10
15 .p2align 3
16 .L2:
17 leaq 1(%rcx), %r8
18 cmpb $0, -1(%r8)
19 je .L11
20 movq %r8, %rcx
21 movq %r9, %rdx
22 .L3:
23 cmpq %rcx, %r10
24 leaq -1(%rdx), %r9
25 jne .L2
26 .L5:
27 subq $8, %rsp
28 call __GI___chk_fail
29 .p2align 4,,10
30 .p2align 3
31 .L11:
32 xorl %r8d, %r8d
33 subq $1, %rcx
34 movzbl (%rsi,%r8), %r9d
35 testb %r9b, %r9b
36 movb %r9b, 1(%rcx,%r8)
37 je .L12
38 .p2align 4,,10
39 .p2align 3
40 .L6:
41 addq $1, %r8
42 cmpq %r8, %rdx
43 je .L5
44 movzbl (%rsi,%r8), %r9d
45 testb %r9b, %r9b
46 movb %r9b, 1(%rcx,%r8)
47 jne .L6
48 .L12:
49 movq %rdi, %rax
50 ret
51 .size __strcat_chk, .-__strcat_chk