From d45005a1d42c1ebda05800abbe5c6bb65c43d94e Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 27 Nov 2025 12:22:05 +0100 Subject: [PATCH] Fix stage 2 build by moving `.bss` section We get `relocation R_386_16 out of range: 74743 is not in [-32768, 65535]` errors with the latest nightlies, as reported in #520. All the failed relocations are from the `.start` section, referencing the `.bss` section. This commit fixes these errors by moving the `.bss` section in between the `.start` and `.text` sections so that it is closer to the `.start` section. --- bios/stage-2/stage-2-link.ld | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bios/stage-2/stage-2-link.ld b/bios/stage-2/stage-2-link.ld index b80c7473..46e15f06 100644 --- a/bios/stage-2/stage-2-link.ld +++ b/bios/stage-2/stage-2-link.ld @@ -6,12 +6,12 @@ SECTIONS { .start : { *(.start) } - .text : { - *(.text .text.*) - } .bss : { *(.bss .bss.*) } + .text : { + *(.text .text.*) + } .rodata : { *(.rodata .rodata.*) }