Skip to content

Commit

Permalink
tools/nolibc: Remove .global _start from the entry point code
Browse files Browse the repository at this point in the history
[ 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>
  • Loading branch information
ammarfaizi2 authored and gregkh committed Jan 18, 2023
1 parent a77c54f commit bd0431a
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 6 deletions.
1 change: 0 additions & 1 deletion tools/include/nolibc/arch-aarch64.h
Expand Up @@ -184,7 +184,6 @@ struct sys_stat_struct {
/* startup code */
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
"ldr x0, [sp]\n" // argc (x0) was in the stack
"add x1, sp, 8\n" // argv (x1) = sp
Expand Down
1 change: 0 additions & 1 deletion tools/include/nolibc/arch-arm.h
Expand Up @@ -177,7 +177,6 @@ struct sys_stat_struct {
/* startup code */
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
#if defined(__THUMBEB__) || defined(__THUMBEL__)
/* We enter here in 32-bit mode but if some previous functions were in
Expand Down
1 change: 0 additions & 1 deletion tools/include/nolibc/arch-i386.h
Expand Up @@ -176,7 +176,6 @@ struct sys_stat_struct {
*/
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
"pop %eax\n" // argc (first arg, %eax)
"mov %esp, %ebx\n" // argv[] (second arg, %ebx)
Expand Down
1 change: 0 additions & 1 deletion tools/include/nolibc/arch-mips.h
Expand Up @@ -192,7 +192,6 @@ struct sys_stat_struct {
asm(".section .text\n"
".weak __start\n"
".set nomips16\n"
".global __start\n"
".set noreorder\n"
".option pic0\n"
".ent __start\n"
Expand Down
1 change: 0 additions & 1 deletion tools/include/nolibc/arch-riscv.h
Expand Up @@ -185,7 +185,6 @@ struct sys_stat_struct {
/* startup code */
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
".option push\n"
".option norelax\n"
Expand Down
1 change: 0 additions & 1 deletion tools/include/nolibc/arch-x86_64.h
Expand Up @@ -199,7 +199,6 @@ struct sys_stat_struct {
*/
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
"pop %rdi\n" // argc (first arg, %rdi)
"mov %rsp, %rsi\n" // argv[] (second arg, %rsi)
Expand Down

0 comments on commit bd0431a

Please sign in to comment.