Some broken software wants to deal with ld.so.cache.
[nyanglibc.git] / nptl / shm-directory.s
blob4395ec276c97e8ef24fb0b99311cb92f5e5bdcb5
1 .text
2 .section .rodata.str1.1,"aMS",@progbits,1
3 .LC0:
4 .string "r"
5 .LC1:
6 .string "/proc/mounts"
7 .LC2:
8 .string "/etc/fstab"
9 .LC3:
10 .string "tmpfs"
11 .LC4:
12 .string "shm"
13 .text
14 .p2align 4,,15
15 .type where_is_shmfs, @function
16 where_is_shmfs:
17 pushq %r15
18 pushq %r14
19 leaq defaultdir(%rip), %rdi
20 pushq %r13
21 pushq %r12
22 pushq %rbp
23 pushq %rbx
24 subq $712, %rsp
25 leaq 64(%rsp), %rbp
26 movq %rbp, %rsi
27 call __statfs@PLT
28 testl %eax, %eax
29 jne .L2
30 movq 64(%rsp), %rax
31 cmpq $16914836, %rax
32 je .L16
33 movl $2240043254, %edx
34 cmpq %rdx, %rax
35 je .L16
36 .L2:
37 leaq .LC0(%rip), %rsi
38 leaq .LC1(%rip), %rdi
39 call __setmntent@PLT
40 testq %rax, %rax
41 movq %rax, %rbx
42 je .L35
43 .L5:
44 leaq 192(%rsp), %r13
45 leaq 16(%rsp), %r12
46 leaq .LC3(%rip), %r14
47 .L12:
48 movl $512, %ecx
49 movq %r13, %rdx
50 movq %r12, %rsi
51 movq %rbx, %rdi
52 call __getmntent_r@PLT
53 testq %rax, %rax
54 movq %rax, %r15
55 je .L10
56 movq 16(%r15), %rax
57 movl $6, %ecx
58 movq %r14, %rdi
59 movq %rax, %rsi
60 repz cmpsb
61 je .L6
62 leaq .LC4(%rip), %rdi
63 movl $4, %ecx
64 movq %rax, %rsi
65 repz cmpsb
66 jne .L12
67 .L6:
68 movq 8(%r15), %rdi
69 movq %rbp, %rsi
70 call __statfs@PLT
71 testl %eax, %eax
72 jne .L12
73 movq 64(%rsp), %rax
74 cmpq $16914836, %rax
75 je .L17
76 movl $2240043254, %esi
77 cmpq %rsi, %rax
78 jne .L12
79 .L17:
80 movq 8(%r15), %r15
81 movq %r15, %rdi
82 call strlen@PLT
83 testq %rax, %rax
84 je .L12
85 leaq 2(%rax), %rdi
86 movq %rax, 8(%rsp)
87 call malloc@PLT
88 testq %rax, %rax
89 movq %rax, %rbp
90 movq %rax, mountpoint(%rip)
91 je .L10
92 movq 8(%rsp), %rdx
93 movq %r15, %rsi
94 movq %rax, %rdi
95 call __mempcpy@PLT
96 cmpb $47, -1(%rax)
97 je .L11
98 movb $47, (%rax)
99 addq $1, %rax
100 .L11:
101 movb $0, (%rax)
102 subq %rbp, %rax
103 movq %rax, 8+mountpoint(%rip)
104 .L10:
105 movq %rbx, %rdi
106 call __endmntent@PLT
107 .L1:
108 addq $712, %rsp
109 popq %rbx
110 popq %rbp
111 popq %r12
112 popq %r13
113 popq %r14
114 popq %r15
116 .p2align 4,,10
117 .p2align 3
118 .L16:
119 leaq defaultdir(%rip), %rax
120 movq $9, 8+mountpoint(%rip)
121 movq %rax, mountpoint(%rip)
122 jmp .L1
123 .p2align 4,,10
124 .p2align 3
125 .L35:
126 leaq .LC0(%rip), %rsi
127 leaq .LC2(%rip), %rdi
128 call __setmntent@PLT
129 testq %rax, %rax
130 movq %rax, %rbx
131 jne .L5
132 jmp .L1
133 .size where_is_shmfs, .-where_is_shmfs
134 .p2align 4,,15
135 .globl __shm_directory
136 .type __shm_directory, @function
137 __shm_directory:
138 pushq %rbx
139 leaq where_is_shmfs(%rip), %rsi
140 movq %rdi, %rbx
141 leaq once(%rip), %rdi
142 call __pthread_once@PLT
143 movq mountpoint(%rip), %rax
144 testq %rax, %rax
145 je .L40
146 movq 8+mountpoint(%rip), %rdx
147 movq %rdx, (%rbx)
148 popq %rbx
150 .p2align 4,,10
151 .p2align 3
152 .L40:
153 movq errno@gottpoff(%rip), %rdx
154 movl $38, %fs:(%rdx)
155 popq %rbx
157 .size __shm_directory, .-__shm_directory
158 .p2align 4,,15
159 .globl __shm_directory_freeres
160 .type __shm_directory_freeres, @function
161 __shm_directory_freeres:
162 movq mountpoint(%rip), %rdi
163 leaq defaultdir(%rip), %rax
164 cmpq %rax, %rdi
165 je .L41
166 jmp free@PLT
167 .p2align 4,,10
168 .p2align 3
169 .L41:
170 rep ret
171 .size __shm_directory_freeres, .-__shm_directory_freeres
172 .local once
173 .comm once,4,4
174 .section .rodata.str1.8,"aMS",@progbits,1
175 .align 8
176 .type defaultdir, @object
177 .size defaultdir, 10
178 defaultdir:
179 .string "/dev/shm/"
180 .local mountpoint
181 .comm mountpoint,16,16
182 .weak __pthread_once