tools/nolibc/arch: mark the _start symbol as weak

[ Upstream commit dffeb81af5fe5eedccf5ea4a8a120d8c3accd26e ]

By doing so we can link together multiple C files that have been compiled
with nolibc and which each have a _start symbol.

Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Stable-dep-of: 184177c3d6e0 ("tools/nolibc: restore mips branch ordering in the _start block")
Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
Willy Tarreau 2022-02-07 17:23:45 +01:00 committed by Greg Kroah-Hartman
parent da51e086d1
commit a77c54f5b5
6 changed files with 6 additions and 0 deletions

View File

@ -183,6 +183,7 @@ 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

View File

@ -176,6 +176,7 @@ struct sys_stat_struct {
/* startup code */
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
#if defined(__THUMBEB__) || defined(__THUMBEL__)

View File

@ -175,6 +175,7 @@ struct sys_stat_struct {
*
*/
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
"pop %eax\n" // argc (first arg, %eax)

View File

@ -190,6 +190,7 @@ struct sys_stat_struct {
/* startup code, note that it's called __start on MIPS */
asm(".section .text\n"
".weak __start\n"
".set nomips16\n"
".global __start\n"
".set noreorder\n"

View File

@ -184,6 +184,7 @@ struct sys_stat_struct {
/* startup code */
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
".option push\n"

View File

@ -198,6 +198,7 @@ struct sys_stat_struct {
*
*/
asm(".section .text\n"
".weak _start\n"
".global _start\n"
"_start:\n"
"pop %rdi\n" // argc (first arg, %rdi)