Re: [PATCH] scripts: Introduce ARCH_WANTS_RELA_DYN to avoid stripping .rela.dyn section
From: Björn Töpel
Date: Fri Mar 28 2025 - 04:19:44 EST
Alexandre Ghiti <alexghiti@xxxxxxxxxxxx> writes:
> riscv uses the .rela.dyn section to relocate the kernel at runtime but
> that section is stripped from vmlinux. That prevents kexec to
> successfully load vmlinux since it does not contain the relocations info
> needed.
>
> Fix this by introducing a new config ARCH_WANTS_RELA_DYN that prevents
> .rela.dyn to be stripped.
>
> Fixes: 71d815bf5dfd ("kbuild: Strip runtime const RELA sections correctly")
> Signed-off-by: Alexandre Ghiti <alexghiti@xxxxxxxxxxxx>
Thanks, Alex! This fix makes it possible to kexec into RISC-V vmlinux w/
CONFIG_RELOCATABLE.
Tested-by: Björn Töpel <bjorn@xxxxxxxxxxxx>
Reviewed-by: Björn Töpel <bjorn@xxxxxxxxxxxx>