Skip to content

Commit

Permalink
x86, boot: Don't compile aslr.c when !CONFIG_RANDOMIZE_BASE
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Josh Triplett committed Aug 17, 2014
1 parent 9a1cb47 commit 9e6abd2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 3 additions & 1 deletion arch/x86/boot/compressed/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 0 additions & 3 deletions arch/x86/boot/compressed/aslr.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
#include "misc.h"

#ifdef CONFIG_RANDOMIZE_BASE
#include <asm/msr.h>
#include <asm/archrandom.h>
#include <asm/e820.h>
Expand Down Expand Up @@ -320,5 +319,3 @@ unsigned char *choose_kernel_location(unsigned char *input,
out:
return (unsigned char *)choice;
}

#endif /* CONFIG_RANDOMIZE_BASE */

0 comments on commit 9e6abd2

Please sign in to comment.