Skip to content

Commit e6a03a6

Browse files
ardbiesheuvelmasahir0y
authored andcommitted
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 9d9173e ("x86/build: Avoid relocation information in final vmlinux") Signed-off-by: Ard Biesheuvel <ardb@kernel.org> Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent ac4f067 commit e6a03a6

File tree

2 files changed

+6
-41
lines changed

2 files changed

+6
-41
lines changed

arch/x86/Makefile.postlink

Lines changed: 0 additions & 38 deletions
This file was deleted.

arch/x86/boot/compressed/Makefile

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -117,9 +117,12 @@ $(obj)/vmlinux.bin: vmlinux FORCE
117117

118118
targets += $(patsubst $(obj)/%,%,$(vmlinux-objs-y)) vmlinux.bin.all vmlinux.relocs
119119

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)
123126

124127
vmlinux.bin.all-y := $(obj)/vmlinux.bin
125128
vmlinux.bin.all-$(CONFIG_X86_NEED_RELOCS) += $(obj)/vmlinux.relocs

0 commit comments

Comments
 (0)