clarify the purpose of this project
[nyanglibc.git] / csu / libc-start.shared.s
blob50c4e4affb4cfe2144ccc94920b099add1fb6b12
1 .text
2 #APP
3 memmove = __GI_memmove
4 memset = __GI_memset
5 memcpy = __GI_memcpy
6 .section .rodata.str1.1,"aMS",@progbits,1
7 .LC0:
8 .string "\ninitialize program: %s\n\n"
9 .LC1:
10 .string "\ntransferring control: %s\n\n"
11 #NO_APP
12 .text
13 .p2align 4,,15
14 .globl __libc_start_main
15 .type __libc_start_main, @function
16 __libc_start_main:
17 pushq %r15
18 pushq %r14
19 pushq %r13
20 pushq %r12
21 pushq %rbp
22 pushq %rbx
23 movq %rcx, %rbp
24 subq $152, %rsp
25 testq %r9, %r9
26 movq %rdi, 24(%rsp)
27 movl %esi, 20(%rsp)
28 movq %rdx, 8(%rsp)
29 je .L5
30 xorl %edx, %edx
31 xorl %esi, %esi
32 movq %r9, %rdi
33 call __GI___cxa_atexit
34 .L5:
35 movq _rtld_global_ro@GOTPCREL(%rip), %rdx
36 movl (%rdx), %ebx
37 andl $2, %ebx
38 jne .L26
39 .L4:
40 testq %rbp, %rbp
41 je .L7
42 movq __environ@GOTPCREL(%rip), %rax
43 movq 8(%rsp), %rsi
44 movl 20(%rsp), %edi
45 movq (%rax), %rdx
46 call *%rbp
47 .L7:
48 movq _rtld_global_ro@GOTPCREL(%rip), %rax
49 movl 800(%rax), %r12d
50 testl %r12d, %r12d
51 jne .L27
52 .L9:
53 testl %ebx, %ebx
54 jne .L28
55 .L18:
56 leaq 32(%rsp), %rdi
57 call __GI__setjmp
58 testl %eax, %eax
59 jne .L20
60 #APP
61 # 325 "../csu/libc-start.c" 1
62 movq %fs:768,%rax
63 # 0 "" 2
64 #NO_APP
65 movq %rax, 104(%rsp)
66 #APP
67 # 326 "../csu/libc-start.c" 1
68 movq %fs:760,%rax
69 # 0 "" 2
70 #NO_APP
71 movq %rax, 112(%rsp)
72 leaq 32(%rsp), %rax
73 #APP
74 # 329 "../csu/libc-start.c" 1
75 movq %rax,%fs:768
76 # 0 "" 2
77 #NO_APP
78 movq __environ@GOTPCREL(%rip), %rax
79 movq 8(%rsp), %rsi
80 movl 20(%rsp), %edi
81 movq (%rax), %rdx
82 movq 24(%rsp), %rax
83 call *%rax
84 .L21:
85 movl %eax, %edi
86 call __GI_exit
87 .L20:
88 movq 216+__libc_pthread_functions(%rip), %rax
89 #APP
90 # 338 "../csu/libc-start.c" 1
91 ror $2*8+1, %rax
92 xor %fs:48, %rax
93 # 0 "" 2
94 #NO_APP
95 call *%rax
96 movq 200+__libc_pthread_functions(%rip), %rax
97 #APP
98 # 350 "../csu/libc-start.c" 1
99 ror $2*8+1, %rax
100 xor %fs:48, %rax
101 # 0 "" 2
102 # 357 "../csu/libc-start.c" 1
103 lock;decl (%rax); sete %dl
104 # 0 "" 2
105 #NO_APP
106 testb %dl, %dl
107 jne .L23
108 movl $60, %edx
109 .p2align 4,,10
110 .p2align 3
111 .L22:
112 xorl %edi, %edi
113 movl %edx, %eax
114 #APP
115 # 35 "../sysdeps/unix/sysv/linux/exit-thread.h" 1
116 syscall
118 # 0 "" 2
119 #NO_APP
120 jmp .L22
121 .L26:
122 movq 8(%rsp), %rax
123 leaq .LC0(%rip), %rdi
124 movq (%rax), %rsi
125 xorl %eax, %eax
126 call *736(%rdx)
127 jmp .L4
128 .L23:
129 xorl %eax, %eax
130 jmp .L21
131 .L27:
132 movq 792(%rax), %r14
133 movq _rtld_global@GOTPCREL(%rip), %rax
134 xorl %ebp, %ebp
135 movq (%rax), %r15
136 leaq 1160(%r15), %r13
137 .L12:
138 cmpl %ebp, %r12d
139 jbe .L9
140 movq 24(%r14), %rax
141 testq %rax, %rax
142 je .L16
143 movq _rtld_global@GOTPCREL(%rip), %rdx
144 leaq 2568(%rdx), %rcx
145 cmpq %rcx, %r15
146 je .L29
147 movq %rbp, %rdi
148 salq $4, %rdi
149 addq %r13, %rdi
150 .L15:
151 call *%rax
152 .L16:
153 movq 64(%r14), %r14
154 addq $1, %rbp
155 jmp .L12
156 .L29:
157 movq %rbp, %rcx
158 salq $4, %rcx
159 leaq 3728(%rdx,%rcx), %rdi
160 jmp .L15
161 .L28:
162 movq 8(%rsp), %rax
163 movq _rtld_global_ro@GOTPCREL(%rip), %rdx
164 leaq .LC1(%rip), %rdi
165 movq (%rax), %rsi
166 xorl %eax, %eax
167 call *736(%rdx)
168 jmp .L18
169 .size __libc_start_main, .-__libc_start_main
170 .hidden __libc_pthread_functions