From: Daniel Palmer <daniel@thingy.jp>
To: w@1wt.eu, linux@weissschuh.net
Cc: linux-kernel@vger.kernel.org, Daniel Palmer <daniel@thingy.jp>
Subject: [PATCH 2/2] tools/nolibc: Don't use stack protector before setting it up
Date: Sat, 25 Apr 2026 20:13:15 +0900 [thread overview]
Message-ID: <20260425111315.3191461-3-daniel@thingy.jp> (raw)
In-Reply-To: <20260425111315.3191461-1-daniel@thingy.jp>
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>
---
tools/include/nolibc/crt.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/include/nolibc/crt.h b/tools/include/nolibc/crt.h
index d8ce91fd2e3b..0fe0a066d15a 100644
--- a/tools/include/nolibc/crt.h
+++ b/tools/include/nolibc/crt.h
@@ -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;
--
2.53.0
prev parent reply other threads:[~2026-04-25 11:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-04-25 11:13 [PATCH 0/2] Small stack protector bits Daniel Palmer
2026-04-25 11:13 ` [PATCH 1/2] tools/nolibc: Rename __no_stack_protector to __nolibc_no_stack_protector Daniel Palmer
2026-04-27 17:24 ` Thomas Weißschuh
2026-04-25 11:13 ` Daniel Palmer [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260425111315.3191461-3-daniel@thingy.jp \
--to=daniel@thingy.jp \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@weissschuh.net \
--cc=w@1wt.eu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®