clarify the purpose of this project
[nyanglibc.git] / grp / getgrnam.s
blobbcb7515c95dd8c6ead58e5336e1d5dcf1a915747
1 .text
2 #APP
3 .section __libc_freeres_ptrs, "aw", %nobits
4 .previous
5 .section .gnu.warning.getgrnam
6 .previous
7 #NO_APP
8 .p2align 4,,15
9 .globl getgrnam
10 .type getgrnam, @function
11 getgrnam:
12 pushq %r14
13 pushq %r13
14 pushq %r12
15 pushq %rbp
16 movq %rdi, %r12
17 pushq %rbx
18 subq $16, %rsp
19 #APP
20 # 116 "../nss/getXXbyYY.c" 1
21 movl %fs:24,%eax
22 # 0 "" 2
23 #NO_APP
24 testl %eax, %eax
25 jne .L2
26 movl $1, %edx
27 #APP
28 # 47 "../sysdeps/unix/sysv/linux/x86/lowlevellock.h" 1
29 cmpxchgl %edx, lock(%rip)
30 # 0 "" 2
31 #NO_APP
32 .L3:
33 movq buffer(%rip), %rdx
34 movq buffer_size.10642(%rip), %rbx
35 testq %rdx, %rdx
36 je .L18
37 .L5:
38 leaq 8(%rsp), %r14
39 leaq resbuf.10643(%rip), %r13
40 jmp .L12
41 .p2align 4,,10
42 .p2align 3
43 .L7:
44 movq %rax, buffer(%rip)
45 .L12:
46 movq %r14, %r8
47 movq %rbx, %rcx
48 movq %r13, %rsi
49 movq %r12, %rdi
50 call __getgrnam_r
51 cmpl $34, %eax
52 jne .L19
53 movq buffer_size.10642(%rip), %rax
54 movq buffer(%rip), %rbp
55 leaq (%rax,%rax), %rbx
56 movq %rbp, %rdi
57 movq %rbx, %rsi
58 movq %rbx, buffer_size.10642(%rip)
59 call realloc@PLT
60 testq %rax, %rax
61 movq %rax, %rdx
62 jne .L7
63 movq %rbp, %rdi
64 call free@PLT
65 movq __libc_errno@gottpoff(%rip), %rax
66 movq $0, buffer(%rip)
67 movl $12, %fs:(%rax)
68 .L9:
69 movq $0, 8(%rsp)
70 .L13:
71 #APP
72 # 163 "../nss/getXXbyYY.c" 1
73 movl %fs:24,%eax
74 # 0 "" 2
75 #NO_APP
76 testl %eax, %eax
77 jne .L10
78 subl $1, lock(%rip)
79 .L11:
80 movq 8(%rsp), %rax
81 addq $16, %rsp
82 popq %rbx
83 popq %rbp
84 popq %r12
85 popq %r13
86 popq %r14
87 ret
88 .p2align 4,,10
89 .p2align 3
90 .L19:
91 cmpq $0, buffer(%rip)
92 jne .L13
93 jmp .L9
94 .p2align 4,,10
95 .p2align 3
96 .L18:
97 movl $1024, %edi
98 movq $1024, buffer_size.10642(%rip)
99 movl $1024, %ebx
100 call malloc@PLT
101 testq %rax, %rax
102 movq %rax, %rdx
103 movq %rax, buffer(%rip)
104 jne .L5
105 jmp .L9
106 .p2align 4,,10
107 .p2align 3
108 .L10:
109 xorl %eax, %eax
110 #APP
111 # 163 "../nss/getXXbyYY.c" 1
112 xchgl %eax, lock(%rip)
113 # 0 "" 2
114 #NO_APP
115 cmpl $1, %eax
116 jle .L11
117 xorl %r10d, %r10d
118 movl $1, %edx
119 movl $129, %esi
120 leaq lock(%rip), %rdi
121 movl $202, %eax
122 #APP
123 # 163 "../nss/getXXbyYY.c" 1
124 syscall
126 # 0 "" 2
127 #NO_APP
128 jmp .L11
129 .p2align 4,,10
130 .p2align 3
131 .L2:
132 xorl %eax, %eax
133 movl $1, %edx
134 lock cmpxchgl %edx, lock(%rip)
135 je .L3
136 leaq lock(%rip), %rdi
137 call __lll_lock_wait_private
138 jmp .L3
139 .size getgrnam, .-getgrnam
140 .local resbuf.10643
141 .comm resbuf.10643,32,32
142 .local buffer_size.10642
143 .comm buffer_size.10642,8,8
144 .section .gnu.warning.getgrnam
145 #,"a",@progbits
146 .align 32
147 .type __evoke_link_warning_getgrnam, @object
148 .size __evoke_link_warning_getgrnam, 132
149 __evoke_link_warning_getgrnam:
150 .string "Using 'getgrnam' in statically linked applications requires at runtime the shared libraries from the glibc version used for linking"
151 .section __libc_freeres_ptrs
152 #,"aw",@progbits
153 .align 8
154 .type buffer, @object
155 .size buffer, 8
156 buffer:
157 .zero 8
158 .local lock
159 .comm lock,4,4
160 .hidden __lll_lock_wait_private
161 .hidden __getgrnam_r