Skip to content

Commit 9219922

Browse files
committed
tools/nolibc: mark start_c as weak
Otherwise the different instances of _start_c from each compilation unit will lead to linker errors: /usr/bin/ld: /tmp/ccSNvRqs.o: in function `_start_c': nolibc-test-foo.c:(.text.nolibc_memset+0x9): multiple definition of `_start_c'; /tmp/ccG25101.o:nolibc-test.c:(.text+0x1ea3): first defined here Fixes: 1733675 ("tools/nolibc: add new crt.h with _start_c") Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Link: https://lore.kernel.org/lkml/20231012-nolibc-start_c-multiple-v1-1-fbfc73e0283f@weissschuh.net/ Link: https://lore.kernel.org/lkml/20231012-nolibc-linkage-test-v1-1-315e682768b4@weissschuh.net/ Acked-by: Willy Tarreau <w@1wt.eu>
1 parent 513bd27 commit 9219922

File tree

1 file changed

+1
-0
lines changed
  • tools/include/nolibc

1 file changed

+1
-0
lines changed

tools/include/nolibc/crt.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const unsigned long *_auxv __attribute__((weak));
1313
static void __stack_chk_init(void);
1414
static void exit(int);
1515

16+
__attribute__((weak))
1617
void _start_c(long *sp)
1718
{
1819
long argc;

0 commit comments

Comments
 (0)