]> Git Repo - J-linux.git/commitdiff
tools/nolibc: crt: mark _start_c() as used
authorThomas Weißschuh <[email protected]>
Mon, 12 Aug 2024 20:50:17 +0000 (22:50 +0200)
committerThomas Weißschuh <[email protected]>
Fri, 16 Aug 2024 15:23:13 +0000 (17:23 +0200)
During LTO the reference from the asm startup code to the _start_c()
function is not visible and _start_c() is removed.
This will then lead to errors during linking.
As _start_c() is indeed always used, mark it as such.

Acked-by: Willy Tarreau <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Thomas Weißschuh <[email protected]>
tools/include/nolibc/crt.h

index ac291574f6c0f2ca2617a4baf906f7acb47b3763..bbcd5fd09806be67749118cbe1f3ed11adab1c4e 100644 (file)
@@ -22,7 +22,7 @@ extern void (*const __init_array_end[])(int, char **, char**) __attribute__((wea
 extern void (*const __fini_array_start[])(void) __attribute__((weak));
 extern void (*const __fini_array_end[])(void) __attribute__((weak));
 
-__attribute__((weak))
+__attribute__((weak,used))
 void _start_c(long *sp)
 {
        long argc;
This page took 0.038203 seconds and 4 git commands to generate.