]> git.karo-electronics.de Git - linux-beck.git/commitdiff
x86, boot: Don't compile aslr.c when !CONFIG_RANDOMIZE_BASE
authorJosh Triplett <josh@joshtriplett.org>
Mon, 10 Mar 2014 20:11:26 +0000 (13:11 -0700)
committerJosh Triplett <josh@joshtriplett.org>
Sun, 17 Aug 2014 21:58:24 +0000 (14:58 -0700)
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>
arch/x86/boot/compressed/Makefile
arch/x86/boot/compressed/aslr.c

index 80709a98cc9c4e88aad711e6c201bcbd82a92def..3b9b00c68fd8d4d53fad3c710e70c46ffb331896 100644 (file)
@@ -28,7 +28,9 @@ HOST_EXTRACFLAGS += -I$(srctree)/tools/include
 
 vmlinux-objs-y := $(obj)/vmlinux.lds $(obj)/head_$(BITS).o $(obj)/misc.o \
        $(obj)/string.o $(obj)/cmdline.o $(obj)/early_serial_console.o \
-       $(obj)/piggy.o $(obj)/cpuflags.o $(obj)/aslr.o
+       $(obj)/piggy.o $(obj)/cpuflags.o
+
+vmlinux-objs-$(CONFIG_RANDOMIZE_BASE) += $(obj)/aslr.o
 
 $(obj)/eboot.o: KBUILD_CFLAGS += -fshort-wchar -mno-red-zone
 
index fc6091abedb7ff363da950a0766f45f9834cf1df..913c999b004527203409e50f385cac2f266a850d 100644 (file)
@@ -1,6 +1,5 @@
 #include "misc.h"
 
-#ifdef CONFIG_RANDOMIZE_BASE
 #include <asm/msr.h>
 #include <asm/archrandom.h>
 #include <asm/e820.h>
@@ -320,5 +319,3 @@ unsigned char *choose_kernel_location(unsigned char *input,
 out:
        return (unsigned char *)choice;
 }
-
-#endif /* CONFIG_RANDOMIZE_BASE */