diff options
author | WANG Rui <wangrui@loongson.cn> | 2023-11-21 08:03:25 +0100 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2023-11-21 08:03:25 +0100 |
commit | cbfd44bd5c6eec0aada0c39130f0b8d7ecba0529 (patch) | |
tree | a34b70ec61f978fdff6cd03fa993fcfb788d8e4e /arch | |
parent | LoongArch: Add dependency between vmlinuz.efi and vmlinux.efi (diff) | |
download | linux-cbfd44bd5c6eec0aada0c39130f0b8d7ecba0529.tar.xz linux-cbfd44bd5c6eec0aada0c39130f0b8d7ecba0529.zip |
LoongArch: Explicitly set -fdirect-access-external-data for vmlinux
After this llvm commit [1], The -fno-pic does not imply direct access
external data. Explicitly set -fdirect-access-external-data for vmlinux
that can avoids GOT entries.
Link: https://github.com/llvm/llvm-project/commit/47eeee297775347cbdb7624d6a766c2a3eec4a59
Suggested-by: Xi Ruoyao <xry111@xry111.site>
Signed-off-by: WANG Rui <wangrui@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/loongarch/Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/arch/loongarch/Makefile b/arch/loongarch/Makefile index a8d65eaf1211..204b94b2e6aa 100644 --- a/arch/loongarch/Makefile +++ b/arch/loongarch/Makefile @@ -68,6 +68,7 @@ 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_CFLAGS_KERNEL += $(call cc-option,-fdirect-access-external-data) KBUILD_AFLAGS_MODULE += $(call cc-option,-fno-direct-access-external-data) KBUILD_CFLAGS_MODULE += $(call cc-option,-fno-direct-access-external-data) KBUILD_AFLAGS_MODULE += $(call cc-option,-mno-relax) $(call cc-option,-Wa$(comma)-mno-relax) |