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