summaryrefslogtreecommitdiff
path: root/tools/include
diff options
context:
space:
mode:
authorThomas Weißschuh <linux@weissschuh.net>2023-04-17 19:01:34 +0300
committerPaul E. McKenney <paulmck@kernel.org>2023-06-09 21:46:08 +0300
commited6c0d89bb391c736850e79dbc82aea5e078a941 (patch)
tree5acf8e09da6801a209edc235b0c32042060ef44e /tools/include
parentc1e30f7d38fd64add1fff08b59c21cf3129e4f7f (diff)
downloadlinux-ed6c0d89bb391c736850e79dbc82aea5e078a941.tar.xz
tools/nolibc: arm: add stackprotector support
Signed-off-by: Thomas Weißschuh <linux@weissschuh.net> Signed-off-by: Willy Tarreau <w@1wt.eu> Signed-off-by: Paul E. McKenney <paulmck@kernel.org>
Diffstat (limited to 'tools/include')
-rw-r--r--tools/include/nolibc/arch-arm.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/tools/include/nolibc/arch-arm.h b/tools/include/nolibc/arch-arm.h
index 2eab1aef321b..202e64f537dc 100644
--- a/tools/include/nolibc/arch-arm.h
+++ b/tools/include/nolibc/arch-arm.h
@@ -199,10 +199,15 @@ struct sys_stat_struct {
char **environ __attribute__((weak));
const unsigned long *_auxv __attribute__((weak));
+#define __ARCH_SUPPORTS_STACK_PROTECTOR
+
/* startup code */
-void __attribute__((weak,noreturn,optimize("omit-frame-pointer"))) _start(void)
+void __attribute__((weak,noreturn,optimize("omit-frame-pointer"),no_stack_protector)) _start(void)
{
__asm__ volatile (
+#ifdef NOLIBC_STACKPROTECTOR
+ "bl __stack_chk_init\n" /* initialize stack protector */
+#endif
"pop {%r0}\n" /* argc was in the stack */
"mov %r1, %sp\n" /* argv = sp */