clarify the purpose of this project
[nyanglibc.git] / stdlib / rtld-cxa_atexit.shared.s
blobc8a3e2a6e71d27b7bb74028789d8259b3bbbca1d
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "cxa_atexit.c"
5 .LC1:
6 .string "l != NULL"
7 .text
8 .p2align 4,,15
9 .globl __new_exitfn
10 .hidden __new_exitfn
11 .type __new_exitfn, @function
12 __new_exitfn:
13 cmpb $0, __exit_funcs_done(%rip)
14 jne .L26
15 pushq %rbx
16 movq (%rdi), %r8
17 xorl %r9d, %r9d
18 movq %rdi, %rbx
19 testq %r8, %r8
20 je .L30
21 .p2align 4,,10
22 .p2align 3
23 .L3:
24 movq 8(%r8), %rax
25 testq %rax, %rax
26 je .L4
27 leaq -1(%rax), %rdx
28 movq %rdx, %rcx
29 salq $5, %rcx
30 cmpq $0, 16(%r8,%rcx)
31 jne .L14
32 salq $5, %rax
33 leaq -48(%r8,%rax), %rcx
34 jmp .L6
35 .p2align 4,,10
36 .p2align 3
37 .L7:
38 subq $32, %rcx
39 leaq -1(%rdx), %rsi
40 cmpq $0, 32(%rcx)
41 jne .L5
42 movq %rsi, %rdx
43 .L6:
44 testq %rdx, %rdx
45 jne .L7
46 .L4:
47 movq (%r8), %rax
48 movq $0, 8(%r8)
49 movq %r8, %r9
50 testq %rax, %rax
51 je .L8
52 movq %rax, %r8
53 jmp .L3
54 .p2align 4,,10
55 .p2align 3
56 .L14:
57 movq %rax, %rdx
58 .p2align 4,,10
59 .p2align 3
60 .L5:
61 cmpq $32, %rdx
62 je .L31
63 movq %rdx, %rax
64 addq $1, %rdx
65 salq $5, %rax
66 movq %rdx, 8(%r8)
67 leaq 16(%r8,%rax), %rax
68 movq $1, (%rax)
69 addq $1, __new_exitfn_called(%rip)
70 .L1:
71 popq %rbx
72 ret
73 .L31:
74 testq %r9, %r9
75 movq %r9, %r8
76 jne .L8
77 movl $1040, %esi
78 movl $1, %edi
79 call *__rtld_calloc(%rip)
80 movq %rax, %r8
81 xorl %eax, %eax
82 testq %r8, %r8
83 je .L1
84 movq (%rbx), %rax
85 movq %rax, (%r8)
86 movq %r8, (%rbx)
87 .p2align 4,,10
88 .p2align 3
89 .L8:
90 leaq 16(%r8), %rax
91 movq $1, 8(%r8)
92 movq $1, (%rax)
93 addq $1, __new_exitfn_called(%rip)
94 jmp .L1
95 .L30:
96 leaq __PRETTY_FUNCTION__.7569(%rip), %rcx
97 leaq .LC0(%rip), %rsi
98 leaq .LC1(%rip), %rdi
99 movl $112, %edx
100 call __GI___assert_fail
101 .L26:
102 xorl %eax, %eax
104 .size __new_exitfn, .-__new_exitfn
105 .section .rodata.str1.1
106 .LC2:
107 .string "func != NULL"
108 .text
109 .p2align 4,,15
110 .globl __internal_atexit
111 .hidden __internal_atexit
112 .type __internal_atexit, @function
113 __internal_atexit:
114 pushq %r13
115 pushq %r12
116 pushq %rbp
117 pushq %rbx
118 subq $8, %rsp
119 testq %rdi, %rdi
120 je .L47
121 cmpq $0, __pthread_mutex_lock@GOTPCREL(%rip)
122 movq %rdi, %rbx
123 movq %rsi, %r13
124 movq %rdx, %r12
125 movq %rcx, %rbp
126 je .L34
127 movq __exit_funcs_lock@GOTPCREL(%rip), %rdi
128 call __pthread_mutex_lock@PLT
129 .L34:
130 movq %rbp, %rdi
131 call __new_exitfn
132 testq %rax, %rax
133 je .L48
134 movq %rbx, %rdi
135 xorl %ebx, %ebx
136 movq %r13, 16(%rax)
137 #APP
138 # 53 "cxa_atexit.c" 1
139 xor __pointer_chk_guard_local(%rip), %rdi
140 rol $2*8+1, %rdi
141 # 0 "" 2
142 #NO_APP
143 cmpq $0, __pthread_mutex_unlock@GOTPCREL(%rip)
144 movq %rdi, 8(%rax)
145 movq %r12, 24(%rax)
146 movq $4, (%rax)
147 je .L32
148 .L45:
149 movq __exit_funcs_lock@GOTPCREL(%rip), %rdi
150 call __pthread_mutex_unlock@PLT
151 .L32:
152 addq $8, %rsp
153 movl %ebx, %eax
154 popq %rbx
155 popq %rbp
156 popq %r12
157 popq %r13
159 .p2align 4,,10
160 .p2align 3
161 .L48:
162 cmpq $0, __pthread_mutex_unlock@GOTPCREL(%rip)
163 movl $-1, %ebx
164 jne .L45
165 addq $8, %rsp
166 movl %ebx, %eax
167 popq %rbx
168 popq %rbp
169 popq %r12
170 popq %r13
172 .L47:
173 leaq __PRETTY_FUNCTION__.7538(%rip), %rcx
174 leaq .LC0(%rip), %rsi
175 leaq .LC2(%rip), %rdi
176 movl $41, %edx
177 call __GI___assert_fail
178 .size __internal_atexit, .-__internal_atexit
179 .p2align 4,,15
180 .globl __cxa_atexit
181 .type __cxa_atexit, @function
182 __cxa_atexit:
183 leaq __exit_funcs(%rip), %rcx
184 jmp __internal_atexit
185 .size __cxa_atexit, .-__cxa_atexit
186 .section .rodata.str1.8,"aMS",@progbits,1
187 .align 8
188 .type __PRETTY_FUNCTION__.7569, @object
189 .size __PRETTY_FUNCTION__.7569, 13
190 __PRETTY_FUNCTION__.7569:
191 .string "__new_exitfn"
192 .section .rodata.str1.16,"aMS",@progbits,1
193 .align 16
194 .type __PRETTY_FUNCTION__.7538, @object
195 .size __PRETTY_FUNCTION__.7538, 18
196 __PRETTY_FUNCTION__.7538:
197 .string "__internal_atexit"
198 .hidden __new_exitfn_called
199 .comm __new_exitfn_called,8,8
200 .hidden __exit_funcs
201 .globl __exit_funcs
202 .section .data.rel.local,"aw",@progbits
203 .align 8
204 .type __exit_funcs, @object
205 .size __exit_funcs, 8
206 __exit_funcs:
207 .quad initial
208 .local initial
209 .comm initial,1040,32
210 .comm __exit_funcs_lock,40,32
211 .weak __pthread_mutex_unlock
212 .weak __pthread_mutex_lock
213 .hidden __rtld_calloc
214 .hidden __exit_funcs_done