Skip to content

Commit e9d86b8

Browse files
author
Alexandre Ghiti
committed
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: 559d1e4 ("riscv: Use --emit-relocs in order to move .rela.dyn in init") Tested-by: Björn Töpel <bjorn@rivosinc.com> Reviewed-by: Björn Töpel <bjorn@rivosinc.com> Acked-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20250408072851.90275-1-alexghiti@rivosinc.com Signed-off-by: Alexandre Ghiti <alexghiti@rivosinc.com>
1 parent ae08d55 commit e9d86b8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/Makefile.vmlinux

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ifdef CONFIG_ARCH_VMLINUX_NEEDS_RELOCS
1313
vmlinux-final := vmlinux.unstripped
1414

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

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

0 commit comments

Comments
 (0)