clarify the purpose of this project
[nyanglibc.git] / nptl / nptl-init.shared.s
bloba240506f94340010822da7d5da0574aacd8adbd5
1 .text
2 .p2align 4,,15
3 .type __nptl_set_robust, @function
4 __nptl_set_robust:
5 addq $736, %rdi
6 movl $24, %esi
7 movl $273, %eax
8 #APP
9 # 119 "nptl-init.c" 1
10 syscall
12 # 0 "" 2
13 #NO_APP
14 ret
15 .size __nptl_set_robust, .-__nptl_set_robust
16 .p2align 4,,15
17 .type sigcancel_handler, @function
18 sigcancel_handler:
19 cmpl $32, %edi
20 je .L14
21 rep ret
22 .p2align 4,,10
23 .p2align 3
24 .L14:
25 pushq %rbp
26 pushq %rbx
27 movq %rsi, %rbx
28 subq $8, %rsp
29 movl 16(%rsi), %ebp
30 call __getpid@PLT
31 cmpl %eax, %ebp
32 je .L15
33 .L3:
34 addq $8, %rsp
35 popq %rbx
36 popq %rbp
37 ret
38 .p2align 4,,10
39 .p2align 3
40 .L15:
41 cmpl $-6, 8(%rbx)
42 jne .L3
43 movq %fs:16, %rsi
44 #APP
45 # 139 "nptl-init.c" 1
46 movl %fs:776,%edx
47 # 0 "" 2
48 #NO_APP
49 jmp .L5
50 .p2align 4,,10
51 .p2align 3
52 .L17:
53 testb $16, %dl
54 jne .L3
55 movl %edx, %eax
56 lock cmpxchgl %ecx, 776(%rsi)
57 cmpl %eax, %edx
58 je .L16
59 movl %eax, %edx
60 .L5:
61 movl %edx, %ecx
62 orl $12, %ecx
63 cmpl %ecx, %edx
64 jne .L17
65 jmp .L3
66 .p2align 4,,10
67 .p2align 3
68 .L16:
69 #APP
70 # 156 "nptl-init.c" 1
71 movq $-1,%fs:1584
72 # 0 "" 2
73 #NO_APP
74 andl $2, %edx
75 je .L3
76 movq %fs:16, %rax
77 #APP
78 # 304 "./pthreadP.h" 1
79 lock;orl $16, 776(%rax)
80 # 0 "" 2
81 # 307 "./pthreadP.h" 1
82 movq %fs:768,%rdi
83 # 0 "" 2
84 #NO_APP
85 call __GI___pthread_unwind
86 .size sigcancel_handler, .-sigcancel_handler
87 .section .rodata.str1.8,"aMS",@progbits,1
88 .align 8
89 .LC0:
90 .string "The futex facility returned an unexpected error code.\n"
91 .text
92 .p2align 4,,15
93 .type sighandler_setxid, @function
94 sighandler_setxid:
95 cmpl $33, %edi
96 je .L31
97 rep ret
98 .p2align 4,,10
99 .p2align 3
100 .L31:
101 pushq %rbp
102 pushq %rbx
103 movq %rsi, %rbx
104 subq $8, %rsp
105 movl 16(%rsi), %ebp
106 call __getpid@PLT
107 cmpl %eax, %ebp
108 je .L32
109 .L18:
110 addq $8, %rsp
111 popq %rbx
112 popq %rbp
114 .p2align 4,,10
115 .p2align 3
116 .L32:
117 cmpl $-6, 8(%rbx)
118 jne .L18
119 movq __xidcmd(%rip), %rax
120 movq 16(%rax), %rsi
121 movq 8(%rax), %rdi
122 movq 24(%rax), %rdx
123 movl (%rax), %eax
124 #APP
125 # 190 "nptl-init.c" 1
126 syscall
128 # 0 "" 2
129 #NO_APP
130 movq __xidcmd(%rip), %rdi
131 movl %eax, %esi
132 negl %esi
133 cmpl $-4096, %eax
134 movl $0, %eax
135 cmovbe %eax, %esi
136 call __nptl_setxid_error
137 movq %fs:16, %rdi
138 leaq 776(%rdi), %rcx
139 .p2align 4,,10
140 .p2align 3
141 .L21:
142 #APP
143 # 202 "nptl-init.c" 1
144 movl %fs:776,%edx
145 # 0 "" 2
146 #NO_APP
147 movl %edx, %esi
148 movl %edx, %eax
149 andl $-65, %esi
150 lock cmpxchgl %esi, (%rcx)
151 cmpl %eax, %edx
152 jne .L21
153 movl $1, 1564(%rdi)
154 xorl %r10d, %r10d
155 addq $1564, %rdi
156 movl $1, %edx
157 movl $129, %esi
158 movl $202, %eax
159 #APP
160 # 209 "../sysdeps/nptl/futex-internal.h" 1
161 syscall
163 # 0 "" 2
164 #NO_APP
165 cmpq $-4096, %rax
166 ja .L33
167 .L22:
168 movq __xidcmd(%rip), %rax
169 movl $-1, %edx
170 lock xaddl %edx, 32(%rax)
171 cmpl $1, %edx
172 jne .L18
173 movq __xidcmd(%rip), %rax
174 xorl %r10d, %r10d
175 movl $129, %esi
176 leaq 32(%rax), %rdi
177 movl $202, %eax
178 #APP
179 # 209 "../sysdeps/nptl/futex-internal.h" 1
180 syscall
182 # 0 "" 2
183 #NO_APP
184 cmpq $-4096, %rax
185 jbe .L18
186 cmpl $-22, %eax
187 je .L18
188 cmpl $-14, %eax
189 je .L18
190 .L23:
191 leaq .LC0(%rip), %rdi
192 call __libc_fatal@PLT
193 .p2align 4,,10
194 .p2align 3
195 .L33:
196 cmpl $-22, %eax
197 je .L22
198 cmpl $-14, %eax
199 je .L22
200 jmp .L23
201 .size sighandler_setxid, .-sighandler_setxid
202 .p2align 4,,15
203 .globl __pthread_initialize_minimal_internal
204 .type __pthread_initialize_minimal_internal, @function
205 __pthread_initialize_minimal_internal:
206 pushq %r12
207 pushq %rbp
208 movl $218, %eax
209 pushq %rbx
210 subq $192, %rsp
211 movq %fs:16, %rdx
212 leaq 720(%rdx), %rdi
213 #APP
214 # 28 "../sysdeps/unix/sysv/linux/pthread-pids.h" 1
215 syscall
217 # 0 "" 2
218 #NO_APP
219 movl %eax, 720(%rdx)
220 leaq 784(%rdx), %rax
221 #APP
222 # 231 "nptl-init.c" 1
223 movq %rax,%fs:1296
224 # 0 "" 2
225 # 232 "nptl-init.c" 1
226 movb $1,%fs:1554
227 # 0 "" 2
228 #NO_APP
229 leaq 736(%rdx), %rdi
230 movq $-32, 744(%rdx)
231 movl $24, %esi
232 movl $273, %eax
233 movq %rdi, 728(%rdx)
234 movq %rdi, 736(%rdx)
235 #APP
236 # 243 "nptl-init.c" 1
237 syscall
239 # 0 "" 2
240 #NO_APP
241 movq __libc_stack_end@GOTPCREL(%rip), %rax
242 movq (%rax), %rax
243 #APP
244 # 252 "nptl-init.c" 1
245 movq %rax,%fs:1688
246 # 0 "" 2
247 #NO_APP
248 movzbl __nptl_initial_report_events(%rip), %eax
249 #APP
250 # 257 "nptl-init.c" 1
251 movb %al,%fs:1553
252 # 0 "" 2
253 #NO_APP
254 leaq 32(%rsp), %rbx
255 leaq sigcancel_handler(%rip), %rax
256 xorl %edx, %edx
257 movl $32, %edi
258 movq $0, 40(%rsp)
259 movl $4, 168(%rsp)
260 movq %rbx, %rsi
261 movq %rax, 32(%rsp)
262 call __libc_sigaction@PLT
263 leaq sighandler_setxid(%rip), %rax
264 xorl %edx, %edx
265 movq %rbx, %rsi
266 movl $33, %edi
267 movl $268435460, 168(%rsp)
268 movq %rax, 32(%rsp)
269 call __libc_sigaction@PLT
270 movabsq $6442450944, %rax
271 leaq 8(%rbx), %rsi
272 orq %rax, 40(%rsp)
273 movl $8, %r10d
274 xorl %edx, %edx
275 movl $1, %edi
276 movl $14, %eax
277 #APP
278 # 279 "nptl-init.c" 1
279 syscall
281 # 0 "" 2
282 #NO_APP
283 leaq __static_tls_size(%rip), %rdi
284 leaq 8(%rsp), %rsi
285 call _dl_get_tls_static_info@PLT
286 movq 8(%rsp), %rcx
287 cmpq $15, %rcx
288 leaq -1(%rcx), %rax
289 ja .L36
290 movq $16, 8(%rsp)
291 movl $15, %eax
292 movl $16, %ecx
293 .L36:
294 movq %rax, __static_tls_align_m1(%rip)
295 movq __static_tls_size(%rip), %rax
296 xorl %edx, %edx
297 leaq 16(%rsp), %rsi
298 movl $3, %edi
299 leaq -1(%rcx,%rax), %rax
300 divq %rcx
301 imulq %rcx, %rax
302 movq %rax, __static_tls_size(%rip)
303 call __getrlimit@PLT
304 testl %eax, %eax
305 jne .L37
306 movq 16(%rsp), %rdx
307 cmpq $-1, %rdx
308 je .L37
309 cmpq $16383, %rdx
310 movl $16384, %eax
311 cmovbe %rax, %rdx
312 jmp .L39
313 .p2align 4,,10
314 .p2align 3
315 .L37:
316 movl $2097152, %edx
317 .L39:
318 movq _rtld_global_ro@GOTPCREL(%rip), %rax
319 movq 24(%rax), %rbx
320 movq __static_tls_size(%rip), %rax
321 addq %rbx, %rax
322 addq $2048, %rax
323 cmpq %rdx, %rax
324 cmovb %rdx, %rax
325 movq %rbx, %rdx
326 leaq -1(%rbx,%rax), %rax
327 negq %rdx
328 andq %rdx, %rax
329 movl $1, %edx
330 movq %rax, 16(%rsp)
331 xorl %eax, %eax
332 lock cmpxchgl %edx, __default_pthread_attr_lock(%rip)
333 jne .L49
334 .L40:
335 movq 16(%rsp), %rax
336 movq %rbx, 16+__default_pthread_attr(%rip)
337 movq %rax, 32+__default_pthread_attr(%rip)
338 xorl %eax, %eax
339 #APP
340 # 319 "nptl-init.c" 1
341 xchgl %eax, __default_pthread_attr_lock(%rip)
342 # 0 "" 2
343 #NO_APP
344 cmpl $1, %eax
345 jg .L50
346 .L41:
347 movq _rtld_global@GOTPCREL(%rip), %rbp
348 movq __GI___pthread_mutex_lock@GOTPCREL(%rip), %rax
349 movq %rax, 3984(%rbp)
350 movq __GI___pthread_mutex_unlock@GOTPCREL(%rip), %rax
351 movq %rax, 3992(%rbp)
352 movl 2444(%rbp), %eax
353 movl $0, 2444(%rbp)
354 testl %eax, %eax
355 leal -1(%rax), %ebx
356 je .L42
357 leaq 2440(%rbp), %r12
358 .p2align 4,,10
359 .p2align 3
360 .L43:
361 movq %r12, %rdi
362 subl $1, %ebx
363 call __GI___pthread_mutex_lock@PLT
364 cmpl $-1, %ebx
365 jne .L43
366 .L42:
367 leaq __make_stacks_executable(%rip), %rax
368 leaq pthread_functions(%rip), %rdx
369 leaq __reclaim_stacks(%rip), %rsi
370 leaq __fork_generation(%rip), %rdi
371 movq %rax, 4008(%rbp)
372 leaq __pthread_init_static_tls(%rip), %rax
373 movq %rax, 4096(%rbp)
374 call __libc_pthread_init@PLT
375 movq %rax, __libc_multiple_threads_ptr(%rip)
376 call __pthread_tunables_init
377 addq $192, %rsp
378 popq %rbx
379 popq %rbp
380 popq %r12
382 .p2align 4,,10
383 .p2align 3
384 .L50:
385 xorl %r10d, %r10d
386 movl $1, %edx
387 movl $129, %esi
388 leaq __default_pthread_attr_lock(%rip), %rdi
389 movl $202, %eax
390 #APP
391 # 319 "nptl-init.c" 1
392 syscall
394 # 0 "" 2
395 #NO_APP
396 jmp .L41
397 .p2align 4,,10
398 .p2align 3
399 .L49:
400 leaq __default_pthread_attr_lock(%rip), %rdi
401 call __lll_lock_wait_private
402 jmp .L40
403 .size __pthread_initialize_minimal_internal, .-__pthread_initialize_minimal_internal
404 .weak __pthread_initialize_minimal
405 .set __pthread_initialize_minimal,__pthread_initialize_minimal_internal
406 .p2align 4,,15
407 .globl __pthread_get_minstack
408 .type __pthread_get_minstack, @function
409 __pthread_get_minstack:
410 movq _rtld_global_ro@GOTPCREL(%rip), %rdx
411 movq __static_tls_size(%rip), %rax
412 addq 24(%rdx), %rax
413 addq $16384, %rax
415 .size __pthread_get_minstack, .-__pthread_get_minstack
416 .local __nptl_initial_report_events
417 .comm __nptl_initial_report_events,1,1
418 .hidden __xidcmd
419 .comm __xidcmd,8,8
420 .section .data.rel.ro,"aw",@progbits
421 .align 32
422 .type pthread_functions, @object
423 .size pthread_functions, 240
424 pthread_functions:
425 .quad __pthread_cond_broadcast
426 .quad __pthread_cond_signal
427 .quad __pthread_cond_wait
428 .quad __pthread_cond_timedwait
429 .quad __pthread_cond_broadcast_2_0
430 .quad __pthread_cond_signal_2_0
431 .quad __pthread_cond_wait_2_0
432 .quad __pthread_cond_timedwait_2_0
433 .quad __pthread_exit
434 .quad __GI___pthread_mutex_destroy
435 .quad __GI___pthread_mutex_init
436 .quad __GI___pthread_mutex_lock
437 .quad __GI___pthread_mutex_unlock
438 .quad __GI___pthread_setcancelstate
439 .quad __pthread_setcanceltype
440 .quad __GI___pthread_cleanup_upto
441 .quad __GI___pthread_once
442 .quad __GI___pthread_rwlock_rdlock
443 .quad __GI___pthread_rwlock_wrlock
444 .quad __GI___pthread_rwlock_unlock
445 .quad __GI___pthread_key_create
446 .quad __GI___pthread_getspecific
447 .quad __GI___pthread_setspecific
448 .quad __pthread_cleanup_push_defer
449 .quad __pthread_cleanup_pop_restore
450 .quad __nptl_nthreads
451 .quad __GI___pthread_unwind
452 .quad __nptl_deallocate_tsd
453 .quad __nptl_setxid
454 .quad __nptl_set_robust
455 .section .rodata.str1.1,"aMS",@progbits,1
456 .type nptl_version, @object
457 .size nptl_version, 5
458 nptl_version:
459 .string "2.33"
460 .hidden __static_tls_align_m1
461 .comm __static_tls_align_m1,8,8
462 .hidden __static_tls_size
463 .comm __static_tls_size,8,8
464 .hidden __libc_multiple_threads_ptr
465 .comm __libc_multiple_threads_ptr,8,8
466 .weak __GI___pthread_setspecific
467 .weak __GI___pthread_getspecific
468 .weak __GI___pthread_key_create
469 .weak __GI___pthread_rwlock_unlock
470 .weak __GI___pthread_rwlock_wrlock
471 .weak __GI___pthread_rwlock_rdlock
472 .weak __GI___pthread_once
473 .weak __GI___pthread_setcancelstate
474 .weak __GI___pthread_mutex_init
475 .weak __GI___pthread_mutex_destroy
476 .weak __GI___pthread_mutex_unlock
477 .weak __GI___pthread_mutex_lock
478 .hidden __nptl_setxid
479 .hidden __nptl_deallocate_tsd
480 .hidden __nptl_nthreads
481 .hidden __lll_lock_wait_private
482 .hidden __pthread_tunables_init
483 .hidden __pthread_init_static_tls
484 .hidden __fork_generation
485 .hidden __reclaim_stacks
486 .hidden __make_stacks_executable
487 .hidden __default_pthread_attr
488 .hidden __default_pthread_attr_lock
489 .hidden __nptl_setxid_error