From 04c7eb43e82effb5088a9600390207cb252fe97c Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 2 Oct 2026 12:50:41 +0200 Subject: [PATCH] libs/libc/machine/x86_64: accept R_X86_64_NONE relocations Since the ELF linker script keeps .eh_frame, a relocatable --gc-sections link leaves R_X86_64_NONE relocations for collected functions. The loader rejected them, so no kernel-mode program could be loaded on x86_64. Assisted-by: Claude:claude-opus-5.5 Signed-off-by: raiden00pl --- libs/libc/machine/x86_64/arch_elf64.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libs/libc/machine/x86_64/arch_elf64.c b/libs/libc/machine/x86_64/arch_elf64.c index 40630d53481..9614ea4582b 100644 --- a/libs/libc/machine/x86_64/arch_elf64.c +++ b/libs/libc/machine/x86_64/arch_elf64.c @@ -153,6 +153,8 @@ int up_relocateadd(const Elf64_Rela *rel, const Elf64_Sym *sym, switch (relotype) { + case R_X86_64_NONE: + break; case R_X86_64_64: /* S + A */ *(uint64_t *)addr = sym->st_value + rel->r_addend; break;