clarify the purpose of this project
[nyanglibc.git] / elf / dl-scope.shared.s
blob6ec98b0f74d91d47766cad52c7eac12a4d0bbad6
1 .text
2 .p2align 4,,15
3 .globl _dl_scope_free
4 .hidden _dl_scope_free
5 .type _dl_scope_free, @function
6 _dl_scope_free:
7 pushq %rbp
8 pushq %rbx
9 movq %rdi, %rbp
10 subq $8, %rsp
11 #APP
12 # 30 "dl-scope.c" 1
13 movl %fs:24,%ebx
14 # 0 "" 2
15 #NO_APP
16 testl %ebx, %ebx
17 jne .L2
18 call *__rtld_free(%rip)
19 .L1:
20 addq $8, %rsp
21 movl %ebx, %eax
22 popq %rbx
23 popq %rbp
24 ret
25 .p2align 4,,10
26 .p2align 3
27 .L2:
28 movq 4104+_rtld_local(%rip), %rbx
29 testq %rbx, %rbx
30 jne .L4
31 movl $408, %edi
32 call *__rtld_malloc(%rip)
33 testq %rax, %rax
34 movq %rax, 4104+_rtld_local(%rip)
35 je .L15
36 movq %rbp, 8(%rax)
37 movq $1, (%rax)
38 xorl %ebx, %ebx
39 jmp .L1
40 .p2align 4,,10
41 .p2align 3
42 .L4:
43 movq (%rbx), %rax
44 cmpq $49, %rax
45 ja .L6
46 leaq 1(%rax), %rdx
47 movq %rdx, (%rbx)
48 movq %rdi, 8(%rbx,%rax,8)
49 xorl %ebx, %ebx
50 jmp .L1
51 .p2align 4,,10
52 .p2align 3
53 .L15:
54 call __thread_gscope_wait
55 movl $1, %ebx
56 movq %rbp, %rdi
57 call *__rtld_free(%rip)
58 jmp .L1
59 .p2align 4,,10
60 .p2align 3
61 .L6:
62 call __thread_gscope_wait
63 movq (%rbx), %rax
64 testq %rax, %rax
65 je .L7
66 .p2align 4,,10
67 .p2align 3
68 .L8:
69 subq $1, %rax
70 movq %rax, (%rbx)
71 movq 8(%rbx,%rax,8), %rdi
72 call *__rtld_free(%rip)
73 movq (%rbx), %rax
74 testq %rax, %rax
75 jne .L8
76 .L7:
77 movl $1, %ebx
78 jmp .L1
79 .size _dl_scope_free, .-_dl_scope_free
80 .hidden __thread_gscope_wait
81 .hidden __rtld_malloc
82 .hidden _rtld_local
83 .hidden __rtld_free