Skip to content
Unverified Commit 28093cfe authored by Yao Zi's avatar Yao Zi Committed by Alexandre Ghiti
Browse files

riscv/kexec_file: Handle R_RISCV_64 in purgatory relocator



Commit 58ff5371 ("riscv: Omit optimized string routines when
using KASAN") introduced calls to EXPORT_SYMBOL() in assembly string
routines, which result in R_RISCV_64 relocations against
.export_symbol section. As these rountines are reused by RISC-V
purgatory and our relocator doesn't recognize these relocations, this
fails kexec-file-load with dmesg like

	[   11.344251] kexec_image: Unknown rela relocation: 2
	[   11.345972] kexec_image: Error loading purgatory ret=-8

Let's support R_RISCV_64 relocation to fix kexec on 64-bit RISC-V.
32-bit variant isn't covered since KEXEC_FILE and KEXEC_PURGATORY isn't
available.

Fixes: 58ff5371 ("riscv: Omit optimized string routines when using KASAN")
Signed-off-by: default avatarYao Zi <ziyao@disroot.org>
Tested-by: default avatarBjörn Töpel <bjorn@rivosinc.com>
Reviewed-by: default avatarBjörn Töpel <bjorn@rivosinc.com>
Link: https://lore.kernel.org/r/20250326051445.55131-2-ziyao@disroot.org


Signed-off-by: default avatarAlexandre Ghiti <alexghiti@rivosinc.com>
parent 00496184
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment