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.
This commit is contained in:
Ivaylo Ivanov
2026-05-28 21:50:28 +03:00
committed by Igor Bełwon
parent c509adb742
commit d712a206bb

View File

@@ -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