Commit 1590c598 authored by Ammar Faizi's avatar Ammar Faizi Committed by Paul E. McKenney

tools/nolibc: Remove .global _start from the entry point code

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: default avatarNick Desaulniers <ndesaulniers@google.com>
Acked-by: default avatarWilly Tarreau <w@1wt.eu>
Signed-off-by: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
Signed-off-by: default avatarPaul E. McKenney <paulmck@kernel.org>
parent 37d62758
...@@ -184,7 +184,6 @@ struct sys_stat_struct { ...@@ -184,7 +184,6 @@ struct sys_stat_struct {
/* startup code */ /* startup code */
__asm__ (".section .text\n" __asm__ (".section .text\n"
".weak _start\n" ".weak _start\n"
".global _start\n"
"_start:\n" "_start:\n"
"ldr x0, [sp]\n" // argc (x0) was in the stack "ldr x0, [sp]\n" // argc (x0) was in the stack
"add x1, sp, 8\n" // argv (x1) = sp "add x1, sp, 8\n" // argv (x1) = sp
......
...@@ -177,7 +177,6 @@ struct sys_stat_struct { ...@@ -177,7 +177,6 @@ struct sys_stat_struct {
/* startup code */ /* startup code */
__asm__ (".section .text\n" __asm__ (".section .text\n"
".weak _start\n" ".weak _start\n"
".global _start\n"
"_start:\n" "_start:\n"
#if defined(__THUMBEB__) || defined(__THUMBEL__) #if defined(__THUMBEB__) || defined(__THUMBEL__)
/* We enter here in 32-bit mode but if some previous functions were in /* We enter here in 32-bit mode but if some previous functions were in
......
...@@ -176,7 +176,6 @@ struct sys_stat_struct { ...@@ -176,7 +176,6 @@ struct sys_stat_struct {
*/ */
__asm__ (".section .text\n" __asm__ (".section .text\n"
".weak _start\n" ".weak _start\n"
".global _start\n"
"_start:\n" "_start:\n"
"pop %eax\n" // argc (first arg, %eax) "pop %eax\n" // argc (first arg, %eax)
"mov %esp, %ebx\n" // argv[] (second arg, %ebx) "mov %esp, %ebx\n" // argv[] (second arg, %ebx)
......
...@@ -192,7 +192,6 @@ struct sys_stat_struct { ...@@ -192,7 +192,6 @@ struct sys_stat_struct {
__asm__ (".section .text\n" __asm__ (".section .text\n"
".weak __start\n" ".weak __start\n"
".set nomips16\n" ".set nomips16\n"
".global __start\n"
".set noreorder\n" ".set noreorder\n"
".option pic0\n" ".option pic0\n"
".ent __start\n" ".ent __start\n"
......
...@@ -185,7 +185,6 @@ struct sys_stat_struct { ...@@ -185,7 +185,6 @@ struct sys_stat_struct {
/* startup code */ /* startup code */
__asm__ (".section .text\n" __asm__ (".section .text\n"
".weak _start\n" ".weak _start\n"
".global _start\n"
"_start:\n" "_start:\n"
".option push\n" ".option push\n"
".option norelax\n" ".option norelax\n"
......
...@@ -199,7 +199,6 @@ struct sys_stat_struct { ...@@ -199,7 +199,6 @@ struct sys_stat_struct {
*/ */
__asm__ (".section .text\n" __asm__ (".section .text\n"
".weak _start\n" ".weak _start\n"
".global _start\n"
"_start:\n" "_start:\n"
"pop %rdi\n" // argc (first arg, %rdi) "pop %rdi\n" // argc (first arg, %rdi)
"mov %rsp, %rsi\n" // argv[] (second arg, %rsi) "mov %rsp, %rsi\n" // argv[] (second arg, %rsi)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment