]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
RISC-V: errata: Use medany for relocatable builds
authorPalmer Dabbelt <palmer@rivosinc.com>
Wed, 26 Mar 2025 22:45:07 +0000 (15:45 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 10 Apr 2025 12:39:32 +0000 (14:39 +0200)
commit0751db851374023be9c75ae7e506d0aa058056fd
tree2403dc4192c3a215f70b5d333ac06a9aafdd76a8
parent92a25feb4546a6c55838d38c6c54d9b04527ad04
RISC-V: errata: Use medany for relocatable builds

[ Upstream commit bb58e1579f431d42469b6aed0f03eff383ba6db5 ]

We're trying to mix non-PIC/PIE objects into the otherwise-PIE
relocatable kernels, to avoid GOT/PLT references during early boot
alternative resolution (which happens before the GOT/PLT are set up).

riscv64-unknown-linux-gnu-ld: arch/riscv/errata/sifive/errata.o: relocation R_RISCV_HI20 against `tlb_flush_all_threshold' can not be used when making a shared object; recompile with -fPIC
riscv64-unknown-linux-gnu-ld: arch/riscv/errata/thead/errata.o: relocation R_RISCV_HI20 against `riscv_cbom_block_size' can not be used when making a shared object; recompile with -fPIC

Fixes: 8dc2a7e8027f ("riscv: Fix relocatable kernels with early alternatives using -fno-pie")
Link: https://lore.kernel.org/r/20250326224506.27165-2-palmer@rivosinc.com
Signed-off-by: Palmer Dabbelt <palmer@rivosinc.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
arch/riscv/errata/Makefile