Commit e9d86b8e authored by Alexandre Ghiti's avatar Alexandre Ghiti
Browse files

scripts: Do not strip .rela.dyn section



The .rela.dyn section contains runtime relocations and is only emitted
for a relocatable kernel.

riscv uses this 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.

Fixes: 559d1e45 ("riscv: Use --emit-relocs in order to move .rela.dyn in init")
Tested-by: default avatarBjörn Töpel <bjorn@rivosinc.com>
Reviewed-by: default avatarBjörn Töpel <bjorn@rivosinc.com>
Acked-by: default avatarArd Biesheuvel <ardb@kernel.org>
Link: https://lore.kernel.org/r/20250408072851.90275-1-alexghiti@rivosinc.com


Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
parent ae08d558
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -13,7 +13,7 @@ ifdef CONFIG_ARCH_VMLINUX_NEEDS_RELOCS
vmlinux-final := vmlinux.unstripped

quiet_cmd_strip_relocs = RSTRIP  $@
      cmd_strip_relocs = $(OBJCOPY) --remove-section='.rel*' $< $@
      cmd_strip_relocs = $(OBJCOPY) --remove-section='.rel*' --remove-section=!'.rel*.dyn' $< $@

vmlinux: $(vmlinux-final) FORCE
	$(call if_changed,strip_relocs)