From d712a206bb5230daf4caba24aec5b2bef5accd91 Mon Sep 17 00:00:00 2001 From: Ivaylo Ivanov Date: Thu, 28 May 2026 21:50:28 +0300 Subject: [PATCH] arm: start: set sp to stack_bottom instead of stack_top For conveniency, stack_bottom points to the end of the stack region in the linker file as it grows backwards on arm: .stack ALIGN(0x1000) : { __stack_top = .; . += 0x1000; __stack_bottom = .; } However, we have somehow missed that and STILL made sp point to __stack_top, which makes it grow backwards into .bss... oops, lol. Tested on qemu-virt set to use cortex-a15. --- arch/arm/start.S | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/arm/start.S b/arch/arm/start.S index a07bd02..bb552a3 100644 --- a/arch/arm/start.S +++ b/arch/arm/start.S @@ -18,7 +18,7 @@ ENTRY(_start) bic r12, #(1<<2 | 1<<0) mcr p15, 0, r12, c1, c0, 0 - ldr sp, =__stack_top + ldr sp, =__stack_bottom /* Zero BSS section */ ldr r0, =__bss_start