summaryrefslogtreecommitdiff
path: root/bootstrap/stage2
diff options
context:
space:
mode:
authorDanny Holman <dholman@gymli.org>2025-10-21 10:10:39 -0500
committerDanny Holman <dholman@gymli.org>2025-10-21 10:10:39 -0500
commitef6d8cc1255ab2868a075a316950c782d44be69d (patch)
tree7f47da47fa89ae74784870b57db6bd2688198929 /bootstrap/stage2
parentbootstrap: stage2: make the build configs modular (diff)
downloadbox-ef6d8cc1255ab2868a075a316950c782d44be69d.tar.gz
box-ef6d8cc1255ab2868a075a316950c782d44be69d.tar.zst
box-ef6d8cc1255ab2868a075a316950c782d44be69d.zip
bootstrap: stage2: page align finished binaryHEADmaster
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>
Diffstat (limited to 'bootstrap/stage2')
-rw-r--r--bootstrap/stage2/arch/x86_64/linker.ld10
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)
}