summaryrefslogtreecommitdiffstats
path: root/arch/x86/Makefile
diff options
context:
space:
mode:
authorKees Cook <keescook@chromium.org>2013-07-08 12:15:17 -0400
committerH. Peter Anvin <hpa@linux.intel.com>2013-08-08 00:00:04 -0400
commita02150610776f66b40257624822a879311592bb2 (patch)
treea14370b350bfead0b692d2b6a4b74f426c17024d /arch/x86/Makefile
parentc095ba7224d8edc71dcef0d655911399a8bd4a3f (diff)
x86, relocs: Move ELF relocation handling to C
Moves the relocation handling into C, after decompression. This requires that the decompressed size is passed to the decompression routine as well so that relocations can be found. Only kernels that need relocation support will use the code (currently just x86_32), but this is laying the ground work for 64-bit using it in support of KASLR. Based on work by Neill Clift and Michael Davidson. Signed-off-by: Kees Cook <keescook@chromium.org> Link: http://lkml.kernel.org/r/20130708161517.GA4832@www.outflux.net Acked-by: Zhang Yanfei <zhangyanfei@cn.fujitsu.com> Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
Diffstat (limited to 'arch/x86/Makefile')
-rw-r--r--arch/x86/Makefile8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 07639c656fcd..41250fb33985 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -16,6 +16,10 @@ endif
16# e.g.: obj-y += foo_$(BITS).o 16# e.g.: obj-y += foo_$(BITS).o
17export BITS 17export BITS
18 18
19ifdef CONFIG_X86_NEED_RELOCS
20 LDFLAGS_vmlinux := --emit-relocs
21endif
22
19ifeq ($(CONFIG_X86_32),y) 23ifeq ($(CONFIG_X86_32),y)
20 BITS := 32 24 BITS := 32
21 UTS_MACHINE := i386 25 UTS_MACHINE := i386
@@ -25,10 +29,6 @@ ifeq ($(CONFIG_X86_32),y)
25 KBUILD_AFLAGS += $(biarch) 29 KBUILD_AFLAGS += $(biarch)
26 KBUILD_CFLAGS += $(biarch) 30 KBUILD_CFLAGS += $(biarch)
27 31
28 ifdef CONFIG_RELOCATABLE
29 LDFLAGS_vmlinux := --emit-relocs
30 endif
31
32 KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return 32 KBUILD_CFLAGS += -msoft-float -mregparm=3 -freg-struct-return
33 33
34 # Never want PIC in a 32-bit kernel, prevent breakage with GCC built 34 # Never want PIC in a 32-bit kernel, prevent breakage with GCC built