summaryrefslogtreecommitdiffstats
path: root/arch/x86
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2019-04-04 14:40:27 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-06-11 12:24:01 +0200
commit4400dcd6947887ed56500dd9303a7c7db366c8df (patch)
treedb0e7f0e36aa6374fcbe45d650d0d2225f3dab69 /arch/x86
parent75ffb58460e3b52ba2589eb4a46b32f12e38e409 (diff)
downloadlinux-stable-4400dcd6947887ed56500dd9303a7c7db366c8df.tar.gz
linux-stable-4400dcd6947887ed56500dd9303a7c7db366c8df.tar.bz2
linux-stable-4400dcd6947887ed56500dd9303a7c7db366c8df.zip
x86/build: Keep local relocations with ld.lld
[ Upstream commit 7c21383f3429dd70da39c0c7f1efa12377a47ab6 ] The LLVM linker (ld.lld) defaults to removing local relocations, which causes KASLR boot failures. ld.bfd and ld.gold already handle this correctly. This adds the explicit instruction "--discard-none" during the link phase. There is no change in output for ld.bfd and ld.gold, but ld.lld now produces an image with all the needed relocations. Signed-off-by: Kees Cook <keescook@chromium.org> Signed-off-by: Borislav Petkov <bp@suse.de> Cc: "H. Peter Anvin" <hpa@zytor.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Nick Desaulniers <ndesaulniers@google.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: clang-built-linux@googlegroups.com Cc: x86-ml <x86@kernel.org> Link: https://lkml.kernel.org/r/20190404214027.GA7324@beast Link: https://github.com/ClangBuiltLinux/linux/issues/404 Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/x86')
-rw-r--r--arch/x86/Makefile2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index e26560cd1844..00e0226634fa 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -47,7 +47,7 @@ export REALMODE_CFLAGS
export BITS
ifdef CONFIG_X86_NEED_RELOCS
- LDFLAGS_vmlinux := --emit-relocs
+ LDFLAGS_vmlinux := --emit-relocs --discard-none
endif
#