Skip to content

Commit a77c54f

Browse files
wtarreaugregkh
authored andcommitted
tools/nolibc/arch: mark the _start symbol as weak
[ Upstream commit dffeb81 ] 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: 184177c ("tools/nolibc: restore mips branch ordering in the _start block") Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent da51e08 commit a77c54f

File tree

6 files changed

+6
-0
lines changed

6 files changed

+6
-0
lines changed

tools/include/nolibc/arch-aarch64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ struct sys_stat_struct {
183183

184184
/* startup code */
185185
asm(".section .text\n"
186+
".weak _start\n"
186187
".global _start\n"
187188
"_start:\n"
188189
"ldr x0, [sp]\n" // argc (x0) was in the stack

tools/include/nolibc/arch-arm.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ struct sys_stat_struct {
176176

177177
/* startup code */
178178
asm(".section .text\n"
179+
".weak _start\n"
179180
".global _start\n"
180181
"_start:\n"
181182
#if defined(__THUMBEB__) || defined(__THUMBEL__)

tools/include/nolibc/arch-i386.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,7 @@ struct sys_stat_struct {
175175
*
176176
*/
177177
asm(".section .text\n"
178+
".weak _start\n"
178179
".global _start\n"
179180
"_start:\n"
180181
"pop %eax\n" // argc (first arg, %eax)

tools/include/nolibc/arch-mips.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ struct sys_stat_struct {
190190

191191
/* startup code, note that it's called __start on MIPS */
192192
asm(".section .text\n"
193+
".weak __start\n"
193194
".set nomips16\n"
194195
".global __start\n"
195196
".set noreorder\n"

tools/include/nolibc/arch-riscv.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ struct sys_stat_struct {
184184

185185
/* startup code */
186186
asm(".section .text\n"
187+
".weak _start\n"
187188
".global _start\n"
188189
"_start:\n"
189190
".option push\n"

tools/include/nolibc/arch-x86_64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -198,6 +198,7 @@ struct sys_stat_struct {
198198
*
199199
*/
200200
asm(".section .text\n"
201+
".weak _start\n"
201202
".global _start\n"
202203
"_start:\n"
203204
"pop %rdi\n" // argc (first arg, %rdi)

0 commit comments

Comments
 (0)