Skip to content

Commit bd0431a

Browse files
ammarfaizi2gregkh
authored andcommitted
tools/nolibc: Remove .global _start from the entry point code
[ Upstream commit 1590c59 ] Building with clang yields the following error: ``` <inline asm>:3:1: error: _start changed binding to STB_GLOBAL .global _start ^ 1 error generated. ``` Make sure only specify one between `.global _start` and `.weak _start`. Remove `.global _start`. Cc: llvm@lists.linux.dev Reviewed-by: Nick Desaulniers <ndesaulniers@google.com> Acked-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Ammar Faizi <ammarfaizi2@gnuweeb.org> Signed-off-by: Paul E. McKenney <paulmck@kernel.org> Stable-dep-of: 184177c ("tools/nolibc: restore mips branch ordering in the _start block") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent a77c54f commit bd0431a

File tree

6 files changed

+0
-6
lines changed

6 files changed

+0
-6
lines changed

tools/include/nolibc/arch-aarch64.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,6 @@ struct sys_stat_struct {
184184
/* startup code */
185185
asm(".section .text\n"
186186
".weak _start\n"
187-
".global _start\n"
188187
"_start:\n"
189188
"ldr x0, [sp]\n" // argc (x0) was in the stack
190189
"add x1, sp, 8\n" // argv (x1) = sp

tools/include/nolibc/arch-arm.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,6 @@ struct sys_stat_struct {
177177
/* startup code */
178178
asm(".section .text\n"
179179
".weak _start\n"
180-
".global _start\n"
181180
"_start:\n"
182181
#if defined(__THUMBEB__) || defined(__THUMBEL__)
183182
/* We enter here in 32-bit mode but if some previous functions were in

tools/include/nolibc/arch-i386.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,6 @@ struct sys_stat_struct {
176176
*/
177177
asm(".section .text\n"
178178
".weak _start\n"
179-
".global _start\n"
180179
"_start:\n"
181180
"pop %eax\n" // argc (first arg, %eax)
182181
"mov %esp, %ebx\n" // argv[] (second arg, %ebx)

tools/include/nolibc/arch-mips.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,6 @@ struct sys_stat_struct {
192192
asm(".section .text\n"
193193
".weak __start\n"
194194
".set nomips16\n"
195-
".global __start\n"
196195
".set noreorder\n"
197196
".option pic0\n"
198197
".ent __start\n"

tools/include/nolibc/arch-riscv.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,6 @@ struct sys_stat_struct {
185185
/* startup code */
186186
asm(".section .text\n"
187187
".weak _start\n"
188-
".global _start\n"
189188
"_start:\n"
190189
".option push\n"
191190
".option norelax\n"

tools/include/nolibc/arch-x86_64.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,6 @@ struct sys_stat_struct {
199199
*/
200200
asm(".section .text\n"
201201
".weak _start\n"
202-
".global _start\n"
203202
"_start:\n"
204203
"pop %rdi\n" // argc (first arg, %rdi)
205204
"mov %rsp, %rsi\n" // argv[] (second arg, %rsi)

0 commit comments

Comments
 (0)