]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
tools/nolibc: Don't use stack protector before setting it up
authorDaniel Palmer <daniel@thingy.jp>
Sat, 25 Apr 2026 11:13:15 +0000 (20:13 +0900)
committerThomas Weißschuh <linux@weissschuh.net>
Mon, 27 Apr 2026 17:09:26 +0000 (19:09 +0200)
The stack protector is configured in _start_c() so we shouldn't
use it before then.

Add __nolibc_no_stack_protector to _start_c() to avoid the compiler
generating stack protector code for _start_c() and thus using it
before its configured.

Signed-off-by: Daniel Palmer <daniel@thingy.jp>
Link: https://patch.msgid.link/20260425111315.3191461-3-daniel@thingy.jp
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net>
tools/include/nolibc/crt.h

index f38590a05adf0b0b1299498c75d17cd4ceee2d05..78124b6598a7291d5ba427ba0226bb5154426dc3 100644 (file)
@@ -47,7 +47,7 @@ char *__nolibc_program_invocation_short_name(char *long_name)
 #endif /* NOLIBC_IGNORE_ERRNO */
 
 void _start_c(long *sp);
-__attribute__((weak,used)) __nolibc_no_sanitize_undefined
+__attribute__((weak,used)) __nolibc_no_sanitize_undefined __nolibc_no_stack_protector
 void _start_c(long *sp)
 {
        long argc;