aboutsummaryrefslogtreecommitdiffstats
path: root/arch
diff options
context:
space:
mode:
authorJosh Triplett <josh@joshtriplett.org>2014-03-10 16:11:26 -0400
committerJosh Triplett <josh@joshtriplett.org>2014-08-17 17:58:24 -0400
commit9e6abd2a98ca599e0efb8c46acc17f17dc1a6fe9 (patch)
treefe4e6b44df6be66c40bf0fda83b4a2a5c5e928a9 /arch
parent9a1cb47112eff140659f04c261ca19fb1f002607 (diff)
x86, boot: Don't compile aslr.c when !CONFIG_RANDOMIZE_BASE
All the code in aslr.c gets compiled out if !CONFIG_RANDOMIZE_BASE, but aslr.o itself still gets compiled in. Eliminate it from the compile entirely in that case. This does not change the generated code at all, in either case. Signed-off-by: Josh Triplett <josh@joshtriplett.org>
Diffstat (limited to 'arch')
-rw-r--r--arch/x86/boot/compressed/Makefile4
-rw-r--r--arch/x86/boot/compressed/aslr.c3
2 files changed, 3 insertions, 4 deletions
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index 80709a98cc9c..3b9b00c68fd8 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -28,7 +28,9 @@ HOST_EXTRACFLAGS += -I$(srctree)/tools/include
28 28
29vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \ 29vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \
30 $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \ 30 $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \
31 $(obj)/piggy.o $(obj)/cpuflags.o $(obj)/aslr.o 31 $(obj)/piggy.o $(obj)/cpuflags.o
32
33vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o
32 34
33$(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone 35$(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
34 36
diff --git a/arch/x86/boot/compressed/aslr.c b/arch/x86/boot/compressed/aslr.c
index fc6091abedb7..913c999b0045 100644
--- a/arch/x86/boot/compressed/aslr.c
+++ b/arch/x86/boot/compressed/aslr.c
@@ -1,6 +1,5 @@
1#include "misc.h" 1#include "misc.h"
2 2
3#ifdef CONFIG_RANDOMIZE_BASE
4#include <asm/msr.h> 3#include <asm/msr.h>
5#include <asm/archrandom.h> 4#include <asm/archrandom.h>
6#include <asm/e820.h> 5#include <asm/e820.h>
@@ -320,5 +319,3 @@ unsigned char *choose_kernel_location(unsigned char *input,
320out: 319out:
321 return (unsigned char *)choice; 320 return (unsigned char *)choice;
322} 321}
323
324#endif /* CONFIG_RANDOMIZE_BASE */