clarify the purpose of this project
[nyanglibc.git] / elf / dl-scope.s
blob3099c6e822bdd133a0e2d88ea83df44bed962f3f
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 free@PLT
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 _dl_scope_free_list(%rip), %rbx
29 testq %rbx, %rbx
30 je .L15
31 movq (%rbx), %rax
32 cmpq $49, %rax
33 ja .L6
34 leaq 1(%rax), %rdx
35 movq %rdx, (%rbx)
36 movq %rdi, 8(%rbx,%rax,8)
37 xorl %ebx, %ebx
38 jmp .L1
39 .p2align 4,,10
40 .p2align 3
41 .L6:
42 call __thread_gscope_wait
43 movq (%rbx), %rax
44 testq %rax, %rax
45 je .L7
46 .p2align 4,,10
47 .p2align 3
48 .L8:
49 subq $1, %rax
50 movq 8(%rbx,%rax,8), %rdi
51 movq %rax, (%rbx)
52 call free@PLT
53 movq (%rbx), %rax
54 testq %rax, %rax
55 jne .L8
56 .L7:
57 movl $1, %ebx
58 jmp .L1
59 .p2align 4,,10
60 .p2align 3
61 .L15:
62 movl $408, %edi
63 call malloc@PLT
64 testq %rax, %rax
65 movq %rax, _dl_scope_free_list(%rip)
66 je .L16
67 movq %rbp, 8(%rax)
68 movq $1, (%rax)
69 xorl %ebx, %ebx
70 jmp .L1
71 .L16:
72 call __thread_gscope_wait
73 movq %rbp, %rdi
74 movl $1, %ebx
75 call free@PLT
76 jmp .L1
77 .size _dl_scope_free, .-_dl_scope_free
78 .hidden __thread_gscope_wait