clarify the purpose of this project
[nyanglibc.git] / inet / gethstbynm.s
bloba9f7fb4d0778c94263a1a0488ce9114a336d96d7
1 .text
2 #APP
3 .section __libc_freeres_ptrs, "aw", %nobits
4 .previous
5 .section .gnu.warning.gethostbyname
6 .previous
7 #NO_APP
8 .p2align 4,,15
9 .globl gethostbyname
10 .type gethostbyname, @function
11 gethostbyname:
12 .LFB84:
13 pushq %r14
14 pushq %r13
15 pushq %r12
16 pushq %rbp
17 pushq %rbx
18 movq %rdi, %rbx
19 subq $16, %rsp
20 movl $0, 4(%rsp)
21 call __resolv_context_get
22 testq %rax, %rax
23 je .L31
24 movq %rax, %r14
25 #APP
26 # 116 "../nss/getXXbyYY.c" 1
27 movl %fs:24,%eax
28 # 0 "" 2
29 #NO_APP
30 testl %eax, %eax
31 jne .L4
32 movl $1, %edx
33 #APP
34 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
35 cmpxchgl %edx, lock(%rip)
36 # 0 "" 2
37 #NO_APP
38 .L5:
39 cmpq $0, buffer(%rip)
40 je .L6
41 .L9:
42 leaq 4(%rsp), %rbp
43 leaq buffer_size.12406(%rip), %r8
44 leaq buffer(%rip), %rcx
45 leaq resbuf.12407(%rip), %rdx
46 xorl %r9d, %r9d
47 movq %rbx, %rsi
48 pushq %rbp
49 pushq $2
50 movq %r14, %rdi
51 pushq $0
52 leaq 32(%rsp), %r12
53 pushq %r12
54 call __nss_hostname_digits_dots_context
55 addq $32, %rsp
56 testl %eax, %eax
57 jne .L11
58 movq buffer(%rip), %rdx
59 testq %rdx, %rdx
60 je .L10
61 leaq resbuf.12407(%rip), %r13
62 jmp .L12
63 .p2align 4,,10
64 .p2align 3
65 .L14:
66 movq %rax, buffer(%rip)
67 .L12:
68 movq buffer_size.12406(%rip), %rcx
69 movq %rbx, %rdi
70 movq %rbp, %r9
71 movq %r12, %r8
72 movq %r13, %rsi
73 call __gethostbyname_r
74 cmpl $34, %eax
75 movq buffer(%rip), %rdi
76 jne .L16
77 cmpl $-1, 4(%rsp)
78 jne .L16
79 movq buffer_size.12406(%rip), %rax
80 leaq (%rax,%rax), %rsi
81 movq %rsi, buffer_size.12406(%rip)
82 call realloc@PLT
83 testq %rax, %rax
84 movq %rax, %rdx
85 jne .L14
86 movq buffer(%rip), %rdi
87 call free@PLT
88 movq __libc_errno@gottpoff(%rip), %rax
89 movq $0, buffer(%rip)
90 movl $12, %fs:(%rax)
91 .L10:
92 movq $0, 8(%rsp)
93 .L11:
94 #APP
95 # 163 "../nss/getXXbyYY.c" 1
96 movl %fs:24,%eax
97 # 0 "" 2
98 #NO_APP
99 testl %eax, %eax
100 jne .L18
101 subl $1, lock(%rip)
102 .L19:
103 movq %r14, %rdi
104 call __resolv_context_put
105 movl 4(%rsp), %eax
106 testl %eax, %eax
107 jne .L32
108 .L20:
109 movq 8(%rsp), %rax
110 .L1:
111 addq $16, %rsp
112 popq %rbx
113 popq %rbp
114 popq %r12
115 popq %r13
116 popq %r14
118 .p2align 4,,10
119 .p2align 3
120 .L32:
121 movq __libc_h_errno@gottpoff(%rip), %rdx
122 movl %eax, %fs:(%rdx)
123 jmp .L20
124 .p2align 4,,10
125 .p2align 3
126 .L16:
127 testq %rdi, %rdi
128 jne .L11
129 jmp .L10
130 .p2align 4,,10
131 .p2align 3
132 .L6:
133 movl $1024, %edi
134 movq $1024, buffer_size.12406(%rip)
135 call malloc@PLT
136 testq %rax, %rax
137 movq %rax, buffer(%rip)
138 je .L10
139 jmp .L9
140 .p2align 4,,10
141 .p2align 3
142 .L18:
143 xorl %eax, %eax
144 #APP
145 # 163 "../nss/getXXbyYY.c" 1
146 xchgl %eax, lock(%rip)
147 # 0 "" 2
148 #NO_APP
149 cmpl $1, %eax
150 jle .L19
151 xorl %r10d, %r10d
152 movl $1, %edx
153 movl $129, %esi
154 leaq lock(%rip), %rdi
155 movl $202, %eax
156 #APP
157 # 163 "../nss/getXXbyYY.c" 1
158 syscall
160 # 0 "" 2
161 #NO_APP
162 jmp .L19
163 .p2align 4,,10
164 .p2align 3
165 .L4:
166 xorl %eax, %eax
167 movl $1, %edx
168 lock cmpxchgl %edx, lock(%rip)
169 je .L5
170 leaq lock(%rip), %rdi
171 call __lll_lock_wait_private
172 jmp .L5
173 .L31:
174 movq __libc_h_errno@gottpoff(%rip), %rax
175 movl $-1, %fs:(%rax)
176 xorl %eax, %eax
177 jmp .L1
178 .LFE84:
179 .size gethostbyname, .-gethostbyname
180 .local resbuf.12407
181 .comm resbuf.12407,32,32
182 .local buffer_size.12406
183 .comm buffer_size.12406,8,8
184 .section .gnu.warning.gethostbyname
185 #,"a",@progbits
186 .align 32
187 .type __evoke_link_warning_gethostbyname, @object
188 .size __evoke_link_warning_gethostbyname, 137
189 __evoke_link_warning_gethostbyname:
190 .string "Using 'gethostbyname' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking"
191 .section __libc_freeres_ptrs
192 #,"aw",@progbits
193 .align 8
194 .type buffer, @object
195 .size buffer, 8
196 buffer:
197 .zero 8
198 .local lock
199 .comm lock,4,4
200 .hidden __lll_lock_wait_private
201 .hidden __resolv_context_put
202 .hidden __gethostbyname_r
203 .hidden __nss_hostname_digits_dots_context
204 .hidden __resolv_context_get