Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

x86: Get rid of Makefile.postlink

Instead of generating the vmlinux.relocs file (needed by the
decompressor build to construct the KASLR relocation tables) as a
vmlinux postlink step, which is dubious because it depends on data that
is stripped from vmlinux before the build completes, generate it from
vmlinux.unstripped, which has been introduced specifically for this
purpose.

This ensures that each artifact is rebuilt as needed, rather than as a
side effect of another build rule.

This effectively reverts commit

9d9173e9ceb6 ("x86/build: Avoid relocation information in final vmlinux")

Signed-off-by: Ard Biesheuvel <ardb@kernel.org>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>

authored by

Ard Biesheuvel and committed by
Masahiro Yamada
e6a03a66 ac4f0678

+6 -41
+6 -3
arch/x86/boot/compressed/Makefile
··· 117 117 118 118 targets += $(patsubst $(obj)/%,%,$(vmlinux-objs-y)) vmlinux.bin.all vmlinux.relocs 119 119 120 - # vmlinux.relocs is created by the vmlinux postlink step. 121 - $(obj)/vmlinux.relocs: vmlinux 122 - @true 120 + CMD_RELOCS = arch/x86/tools/relocs 121 + quiet_cmd_relocs = RELOCS $@ 122 + cmd_relocs = $(CMD_RELOCS) $< > $@;$(CMD_RELOCS) --abs-relocs $< 123 + 124 + $(obj)/vmlinux.relocs: vmlinux.unstripped FORCE 125 + $(call if_changed,relocs) 123 126 124 127 vmlinux.bin.all-y := $(obj)/vmlinux.bin 125 128 vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs