summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Qin <richard.qin.x@gmail.com>2026-05-13 15:53:19 +0800
committerRichard Qin <richard.qin.x@gmail.com>2026-05-13 15:53:19 +0800
commit68fdbf4667b6c9f6d6e6d8adb288bc71ddc7ac02 (patch)
tree645d421662b9f69fefbe69c47dd958e59fcd5501
parent4d1421cd7204d225387bd258245d258c02e594b3 (diff)
downloadlume-68fdbf4667b6c9f6d6e6d8adb288bc71ddc7ac02.tar.gz
lume-68fdbf4667b6c9f6d6e6d8adb288bc71ddc7ac02.tar.xz
feat: add relocation section and fixup handling in linker script
-rw-r--r--na/include/lume/lumeos.lds.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/na/include/lume/lumeos.lds.h b/na/include/lume/lumeos.lds.h
index 76e1e75..a6b2b5f 100644
--- a/na/include/lume/lumeos.lds.h
+++ b/na/include/lume/lumeos.lds.h
@@ -20,6 +20,7 @@
.text : AT(ADDR(.text) - PAGE_OFFSET) { \
_stext = .; \
*(.text .text.*) \
+ *(.fixup) \
_etext = .; \
} = 0
@@ -28,11 +29,24 @@
.rodata : AT(ADDR(.rodata) - PAGE_OFFSET) { \
_srodata = .; \
*(.rodata .rodata.*) \
+ . = ALIGN(8); \
+ __extable_start = .; \
+ KEEP(*(.extable)) \
+ __extable_end = .; \
INIT_ARRAY \
DRIVER_ARRAY \
_erodata = .; \
}
+/* ===== Relocation Table (optional, stays in file image) ===== */
+#define RELOC_SECTION \
+ .reloc : AT(ADDR(.reloc) - PAGE_OFFSET) { \
+ . = ALIGN(8); \
+ __lume_reloc_start = .; \
+ KEEP(*(.lume.reloc .lume.reloc.*)) \
+ __lume_reloc_end = .; \
+ }
+
/* ===== C++ Global Constructor Table ===== */
#define INIT_ARRAY \
. = ALIGN(8); \