From 07a90ea93c756d70b22df27e242f425d41af38b4 Mon Sep 17 00:00:00 2001 From: Alexander von Gluck Date: Tue, 20 May 2025 11:51:56 -0500 Subject: [PATCH] ldscripts/kernel: set load base of 0 * 0463b95 removed a messy workaround ensuring the load address of the kernel was 0 due to riscv64's PIC kernel design breaking rv64 booting. * This is the proper fix to set the load address of our PIC kernel as 0 (triggering a dynamic position) Change-Id: I010d70bef90c84ca0243601b86d79fbb60c38728 Reviewed-on: https://review.haiku-os.org/c/haiku/+/9301 Reviewed-by: Alexander von Gluck Reviewed-by: waddlesplash --- src/system/ldscripts/riscv64/kernel.ld | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/system/ldscripts/riscv64/kernel.ld b/src/system/ldscripts/riscv64/kernel.ld index d6bbb02e9e..2c03ae7496 100644 --- a/src/system/ldscripts/riscv64/kernel.ld +++ b/src/system/ldscripts/riscv64/kernel.ld @@ -9,7 +9,8 @@ OUTPUT_ARCH(riscv) ENTRY(_start) SECTIONS { - . = 0x80000000 + SIZEOF_HEADERS; + /* riscv64 kernel is PIC */ + . = 0x0 + SIZEOF_HEADERS; .interp : { *(.interp) } .note.gnu.build-id : { *(.note.gnu.build-id) }