diff options
author | Huacai Chen <chenhuacai@loongson.cn> | 2023-07-28 04:30:42 +0200 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-07-28 04:30:42 +0200 |
commit | 03c53eb90c0c61885b2175adf8675fb56df7f8db (patch) | |
tree | 4fdcde097f51ca2ebabb67114a1d5032b936e995 /arch/loongarch/Makefile | |
parent | LoongArch: Only fiddle with CHECKFLAGS if `need-compiler' (diff) | |
download | linux-03c53eb90c0c61885b2175adf8675fb56df7f8db.tar.xz linux-03c53eb90c0c61885b2175adf8675fb56df7f8db.zip |
LoongArch: Fix module relocation error with binutils 2.41
Binutils 2.41 enables linker relaxation by default, but the kernel
module loader doesn't support that, so just disable it. Otherwise we
get such an error when loading modules:
"Unknown relocation type 102"
As an alternative, we could add linker relaxation support in the kernel
module loader. But it is relatively large complexity that may or may not
bring a similar gain, and we don't really want to include this linker
pass in the kernel.
Reviewed-by: WANG Xuerui <git@xen0n.name>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to '')
-rw-r--r-- | arch/loongarch/Makefile | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index f2b570633c71..b1e5db51b61c 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -68,6 +68,8 @@ LDFLAGS_vmlinux += -static -n -nostdlib ifdef CONFIG_AS_HAS_EXPLICIT_RELOCS cflags-y += $(call cc-option,-mexplicit-relocs) KBUILD_CFLAGS_KERNEL += $(call cc-option,-mdirect-extern-access) +KBUILD_AFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) +KBUILD_CFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) else cflags-y += $(call cc-option,-mno-explicit-relocs) KBUILD_AFLAGS_KERNEL += -Wa,-mla-global-with-pcrel |