From 76fefff7f1dc96dbb48818256f2307b9bff7af00 Mon Sep 17 00:00:00 2001 From: Richard Qin Date: Sun, 8 Nov 2026 04:20:07 +0800 Subject: [mubios] Fix the link order for the 16-bit entries Signed-off-by: Richard Qin --- mubios/arch/mode_switch.S | 2 +- mubios/arch/reset.S | 2 +- mubios/linker.ld | 10 +++++++++- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/mubios/arch/mode_switch.S b/mubios/arch/mode_switch.S index f114870..df96ce4 100644 --- a/mubios/arch/mode_switch.S +++ b/mubios/arch/mode_switch.S @@ -20,7 +20,7 @@ .intel_syntax noprefix .code16 - .section .text16, "ax" + .section .text16.mode, "ax" .extern post_main diff --git a/mubios/arch/reset.S b/mubios/arch/reset.S index aedf3d1..92dad17 100644 --- a/mubios/arch/reset.S +++ b/mubios/arch/reset.S @@ -22,7 +22,7 @@ .extern enter_protected_mode - .section .text16, "ax" + .section .text16.entry, "ax" .global reset_entry .type reset_entry, @function diff --git a/mubios/linker.ld b/mubios/linker.ld index 85545d3..004c1bc 100644 --- a/mubios/linker.ld +++ b/mubios/linker.ld @@ -35,9 +35,17 @@ SECTIONS __rom_start = .; . = ALIGN(16); + .text16.entry : + { + KEEP(*(.text16 .entry)) + } > ROM + .text16.mode : + { + KEEP(*(.text16.mode)) + } > ROM .text16 : { - KEEP(*(.text16 .text16.*)) + KEEP(*(.text16.mode)) } > ROM . = ALIGN(16); -- cgit v1.2.3