clarify the purpose of this project
[nyanglibc.git] / elf / static-stubs.s
blob1ef28b3368ea89b06f75208f0c044b21ce7f8ce9
1 .text
2 .p2align 4,,15
3 .globl __libc_message
4 .type __libc_message, @function
5 __libc_message:
6 pushq %rbp
7 movq %rsp, %rbp
8 pushq %r15
9 pushq %r14
10 pushq %r13
11 pushq %r12
12 leaq 16(%rbp), %rax
13 pushq %rbx
14 subq $104, %rsp
15 movq %rdx, -80(%rbp)
16 movq %rcx, -72(%rbp)
17 movq %r8, -64(%rbp)
18 movq %r9, -56(%rbp)
19 movzbl (%rsi), %r13d
20 movq %rax, -112(%rbp)
21 leaq -96(%rbp), %rax
22 movl %edi, -132(%rbp)
23 movl $16, -120(%rbp)
24 movq %rax, -104(%rbp)
25 testb %r13b, %r13b
26 je .L45
27 movq %rsi, %r12
28 xorl %ebx, %ebx
29 xorl %r14d, %r14d
30 .p2align 4,,10
31 .p2align 3
32 .L2:
33 movl %r13d, %edx
34 movq %r12, %rax
35 jmp .L11
36 .p2align 4,,10
37 .p2align 3
38 .L5:
39 leaq 1(%rax), %rdi
40 movl $37, %esi
41 call __strchrnul@PLT
42 movzbl (%rax), %edx
43 testb %dl, %dl
44 je .L4
45 .L11:
46 cmpb $37, %dl
47 jne .L5
48 cmpb $115, 1(%rax)
49 jne .L5
50 .L4:
51 cmpb $37, %r13b
52 je .L46
53 .L6:
54 movq %rax, %rsi
55 movq %r12, %rcx
56 subq %r12, %rsi
57 movq %rax, %r12
58 .L9:
59 subq $48, %rsp
60 leal 1(%rbx), %r15d
61 leaq 15(%rsp), %rdx
62 andq $-16, %rdx
63 movq %rcx, (%rdx)
64 movq %rsi, 8(%rdx)
65 movq %r14, 16(%rdx)
66 movzbl (%r12), %r13d
67 testb %r13b, %r13b
68 je .L10
69 movl %r15d, %ebx
70 movq %rdx, %r14
71 jmp .L2
72 .p2align 4,,10
73 .p2align 3
74 .L46:
75 cmpb $115, 1(%r12)
76 jne .L6
77 movl -120(%rbp), %edx
78 cmpl $47, %edx
79 ja .L7
80 movl %edx, %eax
81 addq -104(%rbp), %rax
82 addl $8, %edx
83 movl %edx, -120(%rbp)
84 .L8:
85 movq (%rax), %rcx
86 addq $2, %r12
87 movq %rcx, %rdi
88 movq %rcx, -144(%rbp)
89 call strlen@PLT
90 movq -144(%rbp), %rcx
91 movq %rax, %rsi
92 jmp .L9
93 .p2align 4,,10
94 .p2align 3
95 .L10:
96 movslq %r15d, %rax
97 movslq %ebx, %rdx
98 salq $4, %rax
99 salq $4, %rdx
100 addq $16, %rax
101 subq %rax, %rsp
102 xorl %eax, %eax
103 leaq 15(%rsp), %r12
104 andq $-16, %r12
105 addq %r12, %rdx
106 movq %r12, %r13
107 leaq -16(%r12), %rdi
108 jmp .L13
109 .p2align 4,,10
110 .p2align 3
111 .L47:
112 movq (%r14), %rcx
113 movq 8(%r14), %rsi
114 movq 16(%r14), %r14
115 .L13:
116 movq %rcx, (%rdx)
117 movq %rsi, 8(%rdx)
118 leaq (%rax,%rsi), %rbx
119 subq $16, %rdx
120 cmpq %rdi, %rdx
121 movq %rbx, %rax
122 jne .L47
123 jmp .L12
124 .p2align 4,,10
125 .p2align 3
126 .L48:
127 call __errno_location@PLT
128 cmpl $4, (%rax)
129 jne .L14
130 .L12:
131 movl %r15d, %edx
132 movq %r12, %rsi
133 movl $2, %edi
134 call __writev@PLT
135 cmpq $-1, %rax
136 je .L48
137 .L14:
138 testb $1, -132(%rbp)
139 jne .L49
140 leaq -40(%rbp), %rsp
141 popq %rbx
142 popq %r12
143 popq %r13
144 popq %r14
145 popq %r15
146 popq %rbp
148 .L49:
149 movq _dl_pagesize(%rip), %rax
150 xorl %r9d, %r9d
151 xorl %edi, %edi
152 movl $-1, %r8d
153 movl $34, %ecx
154 movl $3, %edx
155 addq %rax, %rbx
156 negq %rax
157 andq %rax, %rbx
158 movq %rbx, %rsi
159 call __mmap@PLT
160 cmpq $-1, %rax
161 movq %rax, %r14
162 je .L19
163 leal -1(%r15), %edx
164 movl %ebx, (%rax)
165 leaq 4(%rax), %rax
166 salq $4, %rdx
167 leaq 16(%r12,%rdx), %rbx
168 .p2align 4,,10
169 .p2align 3
170 .L17:
171 movq 8(%r13), %rdx
172 movq 0(%r13), %rsi
173 movq %rax, %rdi
174 addq $16, %r13
175 call __mempcpy@PLT
176 cmpq %rbx, %r13
177 jne .L17
178 movb $0, (%rax)
179 #APP
180 # 143 "../sysdeps/posix/libc_fatal.c" 1
181 xchgq %r14, __abort_msg(%rip)
182 # 0 "" 2
183 #NO_APP
184 testq %r14, %r14
185 je .L19
186 movl (%r14), %esi
187 movq %r14, %rdi
188 call __munmap@PLT
189 .L19:
190 call abort@PLT
191 .p2align 4,,10
192 .p2align 3
193 .L45:
194 testb $1, -132(%rbp)
195 jne .L19
196 leaq -40(%rbp), %rsp
197 popq %rbx
198 popq %r12
199 popq %r13
200 popq %r14
201 popq %r15
202 popq %rbp
204 .L7:
205 movq -112(%rbp), %rax
206 leaq 8(%rax), %rdx
207 movq %rdx, -112(%rbp)
208 jmp .L8
209 .size __libc_message, .-__libc_message
210 .section .rodata.str1.1,"aMS",@progbits,1
211 .LC0:
212 .string "%s"
213 .text
214 .p2align 4,,15
215 .globl __libc_fatal
216 .type __libc_fatal, @function
217 __libc_fatal:
218 pushq %rbp
219 pushq %rbx
220 leaq .LC0(%rip), %rbx
221 movq %rdi, %rbp
222 subq $8, %rsp
223 .p2align 4,,10
224 .p2align 3
225 .L51:
226 movq %rbp, %rdx
227 movq %rbx, %rsi
228 movl $1, %edi
229 xorl %eax, %eax
230 call __libc_message
231 jmp .L51
232 .size __libc_fatal, .-__libc_fatal
233 .p2align 4,,15
234 .globl _Unwind_Resume
235 .type _Unwind_Resume, @function
236 _Unwind_Resume:
237 subq $8, %rsp
238 call abort@PLT
239 .size _Unwind_Resume, .-_Unwind_Resume
240 .p2align 4,,15
241 .globl __gcc_personality_v0
242 .type __gcc_personality_v0, @function
243 __gcc_personality_v0:
244 subq $8, %rsp
245 call abort@PLT
246 .size __gcc_personality_v0, .-__gcc_personality_v0