clarify the purpose of this project
[nyanglibc.git] / stdlib / cxa_thread_atexit_impl.shared.s
blob88b7b027938da041d0fbb874a3b8bf4aab935b3d
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 #NO_APP
7 .p2align 4,,15
8 .globl __cxa_thread_atexit_impl
9 .type __cxa_thread_atexit_impl, @function
10 __cxa_thread_atexit_impl:
11 pushq %r13
12 pushq %r12
13 movq %rsi, %r13
14 pushq %rbp
15 pushq %rbx
16 movq %rdi, %rbp
17 movl $32, %esi
18 movl $1, %edi
19 movq %rdx, %r12
20 subq $8, %rsp
21 call calloc@PLT
22 #APP
23 # 102 "cxa_thread_atexit_impl.c" 1
24 xor %fs:48, %rbp
25 rol $2*8+1, %rbp
26 # 0 "" 2
27 #NO_APP
28 movq %rax, %rbx
29 movq %rbp, (%rax)
30 movq %r13, 8(%rax)
31 movq tls_dtor_list@gottpoff(%rip), %rax
32 movq _rtld_global@GOTPCREL(%rip), %rbp
33 movq %fs:(%rax), %rdx
34 leaq 2440(%rbp), %rdi
35 movq %rbx, %fs:(%rax)
36 movq %rdx, 24(%rbx)
37 call *3984(%rbp)
38 testq %r12, %r12
39 jne .L2
40 movq lm_cache@gottpoff(%rip), %r12
41 movq %fs:(%r12), %rax
42 .L3:
43 lock addq $1, 1128(%rax)
44 leaq 2440(%rbp), %rdi
45 call *3992(%rbp)
46 movq %fs:(%r12), %rax
47 movq %rax, 16(%rbx)
48 addq $8, %rsp
49 xorl %eax, %eax
50 popq %rbx
51 popq %rbp
52 popq %r12
53 popq %r13
54 ret
55 .p2align 4,,10
56 .p2align 3
57 .L2:
58 movq %r12, %rdi
59 call _dl_find_dso_for_object@PLT
60 testq %rax, %rax
61 je .L7
62 .L4:
63 movq lm_cache@gottpoff(%rip), %r12
64 movq %rax, %fs:(%r12)
65 jmp .L3
66 .p2align 4,,10
67 .p2align 3
68 .L7:
69 movq 0(%rbp), %rax
70 jmp .L4
71 .size __cxa_thread_atexit_impl, .-__cxa_thread_atexit_impl
72 .p2align 4,,15
73 .globl __GI___call_tls_dtors
74 .hidden __GI___call_tls_dtors
75 .type __GI___call_tls_dtors, @function
76 __GI___call_tls_dtors:
77 pushq %rbp
78 pushq %rbx
79 subq $8, %rsp
80 movq tls_dtor_list@gottpoff(%rip), %rbp
81 movq %fs:0(%rbp), %rbx
82 testq %rbx, %rbx
83 je .L8
84 .p2align 4,,10
85 .p2align 3
86 .L10:
87 movq 24(%rbx), %rdx
88 movq (%rbx), %rax
89 movq 8(%rbx), %rdi
90 #APP
91 # 151 "cxa_thread_atexit_impl.c" 1
92 ror $2*8+1, %rax
93 xor %fs:48, %rax
94 # 0 "" 2
95 #NO_APP
96 movq %rdx, %fs:0(%rbp)
97 call *%rax
98 movq 16(%rbx), %rax
99 lock subq $1, 1128(%rax)
100 movq %rbx, %rdi
101 call free@PLT
102 movq %fs:0(%rbp), %rbx
103 testq %rbx, %rbx
104 jne .L10
105 .L8:
106 addq $8, %rsp
107 popq %rbx
108 popq %rbp
110 .size __GI___call_tls_dtors, .-__GI___call_tls_dtors
111 .globl __call_tls_dtors
112 .set __call_tls_dtors,__GI___call_tls_dtors
113 .section .tbss,"awT",@nobits
114 .align 8
115 .type lm_cache, @object
116 .size lm_cache, 8
117 lm_cache:
118 .zero 8
119 .align 8
120 .type tls_dtor_list, @object
121 .size tls_dtor_list, 8
122 tls_dtor_list:
123 .zero 8