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 <raiden00@railab.me>
This commit is contained in:
raiden00pl 2026-10-02 12:50:41 +02:00 • committed by Xiang Xiao
parent adffae71df
commit 04c7eb43e8

View file

@ -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;