summaryrefslogtreecommitdiff
path: root/arch/powerpc/Makefile.postlink
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2016-11-26 06:26:09 +0300
committerMichael Ellerman <mpe@ellerman.id.au>2017-04-28 14:26:52 +0300
commitf188d0524d7e09f7ec801df9761dc1d898b1a1c0 (patch)
tree15811dd42edca0a08b7e0ad716f332ac5a6c76c5 /arch/powerpc/Makefile.postlink
parent1cd6ed7c2e35a716dcf1347c33f58a7ce7d1414f (diff)
downloadlinux-f188d0524d7e09f7ec801df9761dc1d898b1a1c0.tar.xz
powerpc: Use the new post-link pass to check relocations
Currently powerpc has to introduce a dependency on its default build target zImage in order to run a relocation check pass over the linked vmlinux. This is deficient because the check is not run if the plain vmlinux target is built, or if one of the other boot targets is built. Switch to using the kbuild post-link pass, added in commit fbe6e37dab97 ("kbuild: add arch specific post-link Makefile") in order to run this check. In future powerpc will use this to do more complicated operations, but initially using it for something simple is a good first step. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
Diffstat (limited to 'arch/powerpc/Makefile.postlink')
-rw-r--r--arch/powerpc/Makefile.postlink34
1 files changed, 34 insertions, 0 deletions
diff --git a/arch/powerpc/Makefile.postlink b/arch/powerpc/Makefile.postlink
new file mode 100644
index 000000000000..8c0170e45069
--- /dev/null
+++ b/arch/powerpc/Makefile.postlink
@@ -0,0 +1,34 @@
+# ===========================================================================
+# Post-link powerpc pass
+# ===========================================================================
+#
+# 1. Check that vmlinux relocations look sane
+
+PHONY := __archpost
+__archpost:
+
+include include/config/auto.conf
+include scripts/Kbuild.include
+
+quiet_cmd_relocs_check = CHKREL $@
+ cmd_relocs_check = $(CONFIG_SHELL) $(srctree)/arch/powerpc/relocs_check.sh "$(OBJDUMP)" "$@"
+
+# `@true` prevents complaint when there is nothing to be done
+
+vmlinux: FORCE
+ @true
+ifdef CONFIG_RELOCATABLE
+ $(call if_changed,relocs_check)
+endif
+
+%.ko: FORCE
+ @true
+
+clean:
+ @true
+
+PHONY += FORCE clean
+
+FORCE:
+
+.PHONY: $(PHONY)