Skip to content

Commit afb2a4f

Browse files
jan-kiszkaardbiesheuvel
authored andcommitted
riscv/efistub: Ensure GP-relative addressing is not used
The cflags for the RISC-V efistub were missing -mno-relax, thus were under the risk that the compiler could use GP-relative addressing. That happened for _edata with binutils-2.41 and kernel 6.1, causing the relocation to fail due to an invalid kernel_size in handle_kernel_image. It was not yet observed with newer versions, but that may just be luck. Cc: <stable@vger.kernel.org> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
1 parent 6613476 commit afb2a4f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/firmware/efi/libstub/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ cflags-$(CONFIG_ARM) += -DEFI_HAVE_STRLEN -DEFI_HAVE_STRNLEN \
2828
-DEFI_HAVE_MEMCHR -DEFI_HAVE_STRRCHR \
2929
-DEFI_HAVE_STRCMP -fno-builtin -fpic \
3030
$(call cc-option,-mno-single-pic-base)
31-
cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE
31+
cflags-$(CONFIG_RISCV) += -fpic -DNO_ALTERNATIVE -mno-relax
3232
cflags-$(CONFIG_LOONGARCH) += -fpie
3333

3434
cflags-$(CONFIG_EFI_PARAMS_FROM_FDT) += -I$(srctree)/scripts/dtc/libfdt

0 commit comments

Comments
 (0)