From ef6d8cc1255ab2868a075a316950c782d44be69d Mon Sep 17 00:00:00 2001 From: Danny Holman Date: Tue, 21 Oct 2025 10:10:39 -0500 Subject: bootstrap: stage2: page align finished binary Add constraints to the linker script that ensures each program header is page aligned. This will make it much easier to load the stage 2 binary into memory during boot. Signed-off-by: Danny Holman --- bootstrap/stage2/arch/x86_64/linker.ld | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'bootstrap') diff --git a/bootstrap/stage2/arch/x86_64/linker.ld b/bootstrap/stage2/arch/x86_64/linker.ld index f5489e5..14fe730 100644 --- a/bootstrap/stage2/arch/x86_64/linker.ld +++ b/bootstrap/stage2/arch/x86_64/linker.ld @@ -4,15 +4,19 @@ SECTIONS { . = 0x100000; __bstart = .; - .text : { + .text : ALIGN(4K) { *(.text) } - .data : { + .rodata : ALIGN(4K) { + *(.rodata) + } + + .data : ALIGN(4K) { *(.data) } - .bss : { + .bss : ALIGN(4K) { *(.bss) *(COMMON) } -- cgit v1.2.3