[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20231012193233.207857-3-paulmck@kernel.org>
Date: Thu, 12 Oct 2023 12:32:17 -0700
From: "Paul E. McKenney" <paulmck@...nel.org>
To: linux-kernel@...r.kernel.org
Cc: gwml@...r.gnuweeb.org, kernel-team@...a.com, w@....eu,
Thomas Weißschuh <linux@...ssschuh.net>,
Willy Tarreau <w@....eu>
Subject: [PATCH nolibc 03/19] tools/nolibc: mark start_c as weak
From: Thomas Weißschuh <linux@...ssschuh.net>
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: 17336755150b ("tools/nolibc: add new crt.h with _start_c")
Signed-off-by: Thomas Weißschuh <linux@...ssschuh.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@....eu>
---
tools/include/nolibc/crt.h | 1 +
1 file changed, 1 insertion(+)
diff --git a/tools/include/nolibc/crt.h b/tools/include/nolibc/crt.h
index a5f33fef1672..a05655b4ce1d 100644
--- a/tools/include/nolibc/crt.h
+++ b/tools/include/nolibc/crt.h
@@ -13,6 +13,7 @@ const unsigned long *_auxv __attribute__((weak));
static void __stack_chk_init(void);
static void exit(int);
+__attribute__((weak))
void _start_c(long *sp)
{
long argc;
--
2.40.1
Powered by blists - more mailing lists