Some broken software wants to deal with ld.so.cache.
[nyanglibc.git] / nptl / nptl-init.s
blob83b0585fc998698b1157faacd1d637d4250e44e8
1 .text
2 .p2align 4,,15
3 .type sigcancel_handler, @function
4 sigcancel_handler:
5 .LFB97:
6 cmpl $32, %edi
7 je .L13
8 rep ret
9 .p2align 4,,10
10 .p2align 3
11 .L13:
12 pushq %rbp
13 pushq %rbx
14 movq %rsi, %rbx
15 subq $8, %rsp
16 movl 16(%rsi), %ebp
17 call __getpid@PLT
18 cmpl %eax, %ebp
19 je .L14
20 .L1:
21 addq $8, %rsp
22 popq %rbx
23 popq %rbp
24 ret
25 .p2align 4,,10
26 .p2align 3
27 .L14:
28 cmpl $-6, 8(%rbx)
29 jne .L1
30 movq %fs:16, %rsi
31 #APP
32 # 139 "nptl-init.c" 1
33 movl %fs:776,%edx
34 # 0 "" 2
35 #NO_APP
36 jmp .L3
37 .p2align 4,,10
38 .p2align 3
39 .L16:
40 testb $16, %dl
41 jne .L1
42 movl %edx, %eax
43 lock cmpxchgl %ecx, 776(%rsi)
44 cmpl %eax, %edx
45 je .L15
46 movl %eax, %edx
47 .L3:
48 movl %edx, %ecx
49 orl $12, %ecx
50 cmpl %ecx, %edx
51 jne .L16
52 jmp .L1
53 .p2align 4,,10
54 .p2align 3
55 .L15:
56 #APP
57 # 156 "nptl-init.c" 1
58 movq $-1,%fs:1584
59 # 0 "" 2
60 #NO_APP
61 andl $2, %edx
62 je .L1
63 movq %fs:16, %rax
64 #APP
65 # 304 "./pthreadP.h" 1
66 lock;orl $16, 776(%rax)
67 # 0 "" 2
68 # 307 "./pthreadP.h" 1
69 movq %fs:768,%rdi
70 # 0 "" 2
71 #NO_APP
72 call __pthread_unwind@PLT
73 .LFE97:
74 .size sigcancel_handler, .-sigcancel_handler
75 .section .rodata.str1.8,"aMS",@progbits,1
76 .align 8
77 .LC0:
78 .string "The futex facility returned an unexpected error code.\n"
79 .text
80 .p2align 4,,15
81 .type sighandler_setxid, @function
82 sighandler_setxid:
83 .LFB98:
84 cmpl $33, %edi
85 je .L30
86 rep ret
87 .p2align 4,,10
88 .p2align 3
89 .L30:
90 pushq %rbp
91 pushq %rbx
92 movq %rsi, %rbx
93 subq $8, %rsp
94 movl 16(%rsi), %ebp
95 call __getpid@PLT
96 cmpl %eax, %ebp
97 je .L31
98 .L17:
99 addq $8, %rsp
100 popq %rbx
101 popq %rbp
103 .p2align 4,,10
104 .p2align 3
105 .L31:
106 cmpl $-6, 8(%rbx)
107 jne .L17
108 movq __xidcmd(%rip), %rax
109 movq 16(%rax), %rsi
110 movq 8(%rax), %rdi
111 movq 24(%rax), %rdx
112 movl (%rax), %eax
113 #APP
114 # 190 "nptl-init.c" 1
115 syscall
117 # 0 "" 2
118 #NO_APP
119 movq __xidcmd(%rip), %rdi
120 movl %eax, %esi
121 negl %esi
122 cmpl $-4096, %eax
123 movl $0, %eax
124 cmovbe %eax, %esi
125 call __nptl_setxid_error@PLT
126 movq %fs:16, %rdi
127 leaq 776(%rdi), %rcx
128 .p2align 4,,10
129 .p2align 3
130 .L20:
131 #APP
132 # 202 "nptl-init.c" 1
133 movl %fs:776,%edx
134 # 0 "" 2
135 #NO_APP
136 movl %edx, %esi
137 movl %edx, %eax
138 andl $-65, %esi
139 lock cmpxchgl %esi, (%rcx)
140 cmpl %eax, %edx
141 jne .L20
142 movl $1, 1564(%rdi)
143 xorl %r10d, %r10d
144 addq $1564, %rdi
145 movl $1, %edx
146 movl $129, %esi
147 movl $202, %eax
148 #APP
149 # 209 "../sysdeps/nptl/futex-internal.h" 1
150 syscall
152 # 0 "" 2
153 #NO_APP
154 cmpq $-4096, %rax
155 ja .L32
156 .L21:
157 movq __xidcmd(%rip), %rax
158 movl $-1, %edx
159 lock xaddl %edx, 32(%rax)
160 cmpl $1, %edx
161 jne .L17
162 movq __xidcmd(%rip), %rax
163 xorl %r10d, %r10d
164 movl $129, %esi
165 leaq 32(%rax), %rdi
166 movl $202, %eax
167 #APP
168 # 209 "../sysdeps/nptl/futex-internal.h" 1
169 syscall
171 # 0 "" 2
172 #NO_APP
173 cmpq $-4096, %rax
174 jbe .L17
175 cmpl $-22, %eax
176 je .L17
177 cmpl $-14, %eax
178 je .L17
179 .L22:
180 leaq .LC0(%rip), %rdi
181 call __libc_fatal@PLT
182 .p2align 4,,10
183 .p2align 3
184 .L32:
185 cmpl $-22, %eax
186 je .L21
187 cmpl $-14, %eax
188 je .L21
189 jmp .L22
190 .LFE98:
191 .size sighandler_setxid, .-sighandler_setxid
192 .p2align 4,,15
193 .globl __nptl_set_robust
194 .type __nptl_set_robust, @function
195 __nptl_set_robust:
196 .LFB96:
197 addq $736, %rdi
198 movl $24, %esi
199 movl $273, %eax
200 #APP
201 # 119 "nptl-init.c" 1
202 syscall
204 # 0 "" 2
205 #NO_APP
207 .LFE96:
208 .size __nptl_set_robust, .-__nptl_set_robust
209 .p2align 4,,15
210 .globl __pthread_initialize_minimal_internal
211 .type __pthread_initialize_minimal_internal, @function
212 __pthread_initialize_minimal_internal:
213 .LFB99:
214 pushq %rbx
215 movl $218, %eax
216 subq $192, %rsp
217 movq %fs:16, %rdx
218 leaq 720(%rdx), %rdi
219 #APP
220 # 28 "../sysdeps/unix/sysv/linux/pthread-pids.h" 1
221 syscall
223 # 0 "" 2
224 #NO_APP
225 movl %eax, 720(%rdx)
226 leaq 784(%rdx), %rax
227 #APP
228 # 231 "nptl-init.c" 1
229 movq %rax,%fs:1296
230 # 0 "" 2
231 # 232 "nptl-init.c" 1
232 movb $1,%fs:1554
233 # 0 "" 2
234 #NO_APP
235 leaq 736(%rdx), %rdi
236 movq $-32, 744(%rdx)
237 movl $24, %esi
238 movl $273, %eax
239 movq %rdi, 728(%rdx)
240 movq %rdi, 736(%rdx)
241 #APP
242 # 243 "nptl-init.c" 1
243 syscall
245 # 0 "" 2
246 #NO_APP
247 movq __libc_stack_end(%rip), %rax
248 #APP
249 # 252 "nptl-init.c" 1
250 movq %rax,%fs:1688
251 # 0 "" 2
252 #NO_APP
253 movzbl __nptl_initial_report_events(%rip), %eax
254 #APP
255 # 257 "nptl-init.c" 1
256 movb %al,%fs:1553
257 # 0 "" 2
258 #NO_APP
259 leaq 32(%rsp), %rbx
260 leaq sigcancel_handler(%rip), %rax
261 xorl %edx, %edx
262 movl $32, %edi
263 movq $0, 40(%rsp)
264 movl $4, 168(%rsp)
265 movq %rbx, %rsi
266 movq %rax, 32(%rsp)
267 call __libc_sigaction@PLT
268 leaq sighandler_setxid(%rip), %rax
269 xorl %edx, %edx
270 movq %rbx, %rsi
271 movl $33, %edi
272 movl $268435460, 168(%rsp)
273 movq %rax, 32(%rsp)
274 call __libc_sigaction@PLT
275 movabsq $6442450944, %rax
276 leaq 8(%rbx), %rsi
277 orq %rax, 40(%rsp)
278 movl $8, %r10d
279 xorl %edx, %edx
280 movl $1, %edi
281 movl $14, %eax
282 #APP
283 # 279 "nptl-init.c" 1
284 syscall
286 # 0 "" 2
287 #NO_APP
288 leaq __static_tls_size(%rip), %rdi
289 leaq 8(%rsp), %rsi
290 call _dl_get_tls_static_info@PLT
291 movq 8(%rsp), %rcx
292 cmpq $15, %rcx
293 leaq -1(%rcx), %rax
294 ja .L36
295 movq $16, 8(%rsp)
296 movl $15, %eax
297 movl $16, %ecx
298 .L36:
299 movq %rax, __static_tls_align_m1(%rip)
300 movq __static_tls_size(%rip), %rax
301 xorl %edx, %edx
302 leaq 16(%rsp), %rsi
303 movl $3, %edi
304 leaq -1(%rcx,%rax), %rax
305 divq %rcx
306 imulq %rcx, %rax
307 movq %rax, __static_tls_size(%rip)
308 call __getrlimit@PLT
309 testl %eax, %eax
310 jne .L37
311 movq 16(%rsp), %rcx
312 cmpq $-1, %rcx
313 je .L37
314 cmpq $16383, %rcx
315 movl $16384, %eax
316 cmovbe %rax, %rcx
317 jmp .L39
318 .p2align 4,,10
319 .p2align 3
320 .L37:
321 movl $2097152, %ecx
322 .L39:
323 movq _dl_pagesize(%rip), %rdx
324 movq __static_tls_size(%rip), %rax
325 addq %rdx, %rax
326 addq $2048, %rax
327 cmpq %rcx, %rax
328 cmovb %rcx, %rax
329 leaq -1(%rdx,%rax), %rax
330 negq %rdx
331 andq %rax, %rdx
332 xorl %eax, %eax
333 movq %rdx, 16(%rsp)
334 movl $1, %edx
335 lock cmpxchgl %edx, __default_pthread_attr_lock(%rip)
336 jne .L43
337 .L40:
338 movq 16(%rsp), %rax
339 movq %rax, 32+__default_pthread_attr(%rip)
340 movq _dl_pagesize(%rip), %rax
341 movq %rax, 16+__default_pthread_attr(%rip)
342 xorl %eax, %eax
343 #APP
344 # 319 "nptl-init.c" 1
345 xchgl %eax, __default_pthread_attr_lock(%rip)
346 # 0 "" 2
347 #NO_APP
348 cmpl $1, %eax
349 jg .L44
350 .L41:
351 movq __pthread_init_static_tls@GOTPCREL(%rip), %rax
352 movq __reclaim_stacks@GOTPCREL(%rip), %rsi
353 leaq __fork_generation(%rip), %rdi
354 xorl %edx, %edx
355 movq %rax, _dl_init_static_tls(%rip)
356 call __libc_pthread_init@PLT
357 movq %rax, __libc_multiple_threads_ptr(%rip)
358 call __pthread_tunables_init@PLT
359 addq $192, %rsp
360 popq %rbx
362 .p2align 4,,10
363 .p2align 3
364 .L44:
365 xorl %r10d, %r10d
366 movl $1, %edx
367 movl $129, %esi
368 leaq __default_pthread_attr_lock(%rip), %rdi
369 movl $202, %eax
370 #APP
371 # 319 "nptl-init.c" 1
372 syscall
374 # 0 "" 2
375 #NO_APP
376 jmp .L41
377 .p2align 4,,10
378 .p2align 3
379 .L43:
380 leaq __default_pthread_attr_lock(%rip), %rdi
381 call __lll_lock_wait_private@PLT
382 jmp .L40
383 .LFE99:
384 .size __pthread_initialize_minimal_internal, .-__pthread_initialize_minimal_internal
385 .weak __pthread_initialize_minimal
386 .set __pthread_initialize_minimal,__pthread_initialize_minimal_internal
387 .p2align 4,,15
388 .globl __pthread_get_minstack
389 .type __pthread_get_minstack, @function
390 __pthread_get_minstack:
391 .LFB100:
392 movq __static_tls_size(%rip), %rax
393 addq _dl_pagesize(%rip), %rax
394 addq $16384, %rax
396 .LFE100:
397 .size __pthread_get_minstack, .-__pthread_get_minstack
398 .local __nptl_initial_report_events
399 .comm __nptl_initial_report_events,1,1
400 .comm __xidcmd,8,8
401 .section .rodata.str1.1,"aMS",@progbits,1
402 .type nptl_version, @object
403 .size nptl_version, 5
404 nptl_version:
405 .string "2.33"
406 .comm __static_tls_align_m1,8,8
407 .comm __static_tls_size,8,8
408 .comm __libc_multiple_threads_ptr,8,8