clarify the purpose of this project
[nyanglibc.git] / malloc / set-freeres.s
blob3c03d2be72c2a3b5d96c5a262c79f1d16755f3ff
1 .text
2 .section __libc_freeres_fn,"ax",@progbits
3 .p2align 4,,15
4 .globl __libc_freeres
5 .hidden __libc_freeres
6 .type __libc_freeres, @function
7 __libc_freeres:
8 xorl %eax, %eax
9 movl $1, %edx
10 lock cmpxchgq %rdx, already_called.12664(%rip)
11 jne .L32
12 pushq %rbp
13 pushq %rbx
14 subq $8, %rsp
15 cmpq $0, __nss_module_freeres@GOTPCREL(%rip)
16 je .L3
17 call __nss_module_freeres@PLT
18 .L3:
19 cmpq $0, __nss_action_freeres@GOTPCREL(%rip)
20 je .L4
21 call __nss_action_freeres@PLT
22 .L4:
23 cmpq $0, __nss_database_freeres@GOTPCREL(%rip)
24 je .L5
25 call __nss_database_freeres@PLT
26 .L5:
27 call _IO_cleanup@PLT
28 movq __start___libc_subfreeres@GOTPCREL(%rip), %rbx
29 movq __stop___libc_subfreeres@GOTPCREL(%rip), %rax
30 cmpq %rax, %rbx
31 jnb .L6
32 movq %rbx, %rdx
33 notq %rdx
34 addq %rdx, %rax
35 shrq $3, %rax
36 leaq 8(%rbx,%rax,8), %rbp
37 .p2align 4,,10
38 .p2align 3
39 .L7:
40 call *(%rbx)
41 addq $8, %rbx
42 cmpq %rbp, %rbx
43 jne .L7
44 .L6:
45 cmpq $0, __libdl_freeres@GOTPCREL(%rip)
46 je .L8
47 call __libdl_freeres@PLT
48 .L8:
49 cmpq $0, __libpthread_freeres@GOTPCREL(%rip)
50 je .L9
51 call __libpthread_freeres@PLT
52 .L9:
53 movq __start___libc_freeres_ptrs@GOTPCREL(%rip), %rbx
54 movq __stop___libc_freeres_ptrs@GOTPCREL(%rip), %rax
55 cmpq %rax, %rbx
56 jnb .L1
57 movq %rbx, %rdx
58 notq %rdx
59 addq %rdx, %rax
60 shrq $3, %rax
61 leaq 8(%rbx,%rax,8), %rbp
62 .p2align 4,,10
63 .p2align 3
64 .L10:
65 movq (%rbx), %rdi
66 addq $8, %rbx
67 call free@PLT
68 cmpq %rbp, %rbx
69 jne .L10
70 .L1:
71 addq $8, %rsp
72 popq %rbx
73 popq %rbp
74 ret
75 .L32:
76 ret
77 .size __libc_freeres, .-__libc_freeres
78 .local already_called.12664
79 .comm already_called.12664,8,8
80 .weak __stop___libc_freeres_ptrs
81 .weak __start___libc_freeres_ptrs
82 .weak __libpthread_freeres
83 .weak __libdl_freeres
84 .weak __stop___libc_subfreeres
85 .weak __start___libc_subfreeres
86 .weak __nss_database_freeres
87 .weak __nss_action_freeres
88 .weak __nss_module_freeres
89 .hidden __nss_database_freeres
90 .hidden __nss_action_freeres
91 .hidden __nss_module_freeres