diff options
| author | Danny Holman <dholman@gymli.org> | 2025-10-21 10:10:39 -0500 |
|---|---|---|
| committer | Danny Holman <dholman@gymli.org> | 2025-10-21 10:10:39 -0500 |
| commit | ef6d8cc1255ab2868a075a316950c782d44be69d (patch) | |
| tree | 7f47da47fa89ae74784870b57db6bd2688198929 | |
| parent | bootstrap: stage2: make the build configs modular (diff) | |
| download | box-ef6d8cc1255ab2868a075a316950c782d44be69d.tar.gz box-ef6d8cc1255ab2868a075a316950c782d44be69d.tar.zst box-ef6d8cc1255ab2868a075a316950c782d44be69d.zip | |
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 <dholman@gymli.org>
| -rw-r--r-- | bootstrap/stage2/arch/x86_64/linker.ld | 10 |
1 files changed, 7 insertions, 3 deletions
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) } |
