clarify the purpose of this project
[nyanglibc.git] / dirent / rtld-readdir64.shared.s
blobf9e0ff0ae4998d50c89323c2a2877462d6f23ee7
1 .text
2 .p2align 4,,15
3 .globl __readdir64
4 .type __readdir64, @function
5 __readdir64:
6 pushq %r12
7 movl rtld_errno(%rip), %r12d
8 pushq %rbp
9 leaq 96(%rdi), %rbp
10 pushq %rbx
11 movq %rdi, %rbx
12 movq 64(%rdi), %rdx
13 jmp .L7
14 .p2align 4,,10
15 .p2align 3
16 .L3:
17 addq %rbx, %rax
18 movzwl 16(%rax), %ecx
19 addq %rcx, %rdx
20 cmpq $0, (%rax)
21 movq 8(%rax), %rcx
22 movq %rdx, 64(%rbx)
23 movq %rcx, 72(%rbx)
24 jne .L1
25 .L7:
26 cmpq %rdx, 56(%rbx)
27 leaq 96(%rdx), %rax
28 ja .L3
29 movq 48(%rbx), %rdx
30 movl (%rbx), %edi
31 movq %rbp, %rsi
32 call __getdents64@PLT
33 cmpq $0, %rax
34 jle .L15
35 movq %rax, 56(%rbx)
36 xorl %edx, %edx
37 movl $96, %eax
38 jmp .L3
39 .p2align 4,,10
40 .p2align 3
41 .L15:
42 jne .L16
43 .L5:
44 movl %r12d, rtld_errno(%rip)
45 xorl %eax, %eax
46 .L1:
47 popq %rbx
48 popq %rbp
49 popq %r12
50 ret
51 .L16:
52 xorl %eax, %eax
53 cmpl $2, rtld_errno(%rip)
54 jne .L1
55 jmp .L5
56 .size __readdir64, .-__readdir64
57 .weak readdir
58 .set readdir,__readdir64
59 .weak readdir64
60 .set readdir64,__readdir64
61 .globl __readdir
62 .set __readdir,__readdir64
63 .hidden rtld_errno