blob: a6c77f4d32b276e469da37c07c59f3a9a6940b36 [file] [log] [blame]
Greg Kroah-Hartmanb2441312017-11-01 15:07:57 +01001# SPDX-License-Identifier: GPL-2.0
Nicholas Pigginf188d052016-11-26 14:26:09 +11002# ===========================================================================
3# Post-link powerpc pass
4# ===========================================================================
5#
6# 1. Check that vmlinux relocations look sane
7
8PHONY := __archpost
9__archpost:
10
Horia Geantă24e0bfb2017-05-08 11:50:16 +030011-include include/config/auto.conf
Nicholas Pigginf188d052016-11-26 14:26:09 +110012include scripts/Kbuild.include
13
Nicholas Pigginc494ade2017-05-12 03:40:39 +100014quiet_cmd_head_check = CHKHEAD $@
15 cmd_head_check = $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/head_check.sh "$(NM)" "$@"
16
Nicholas Pigginf188d052016-11-26 14:26:09 +110017quiet_cmd_relocs_check = CHKREL $@
Nicholas Piggin4ea80652017-05-12 03:40:38 +100018ifdef CONFIG_PPC_BOOK3S_64
19 cmd_relocs_check = \
Alexandre Ghiti43e76cd2020-01-18 12:03:35 -050020 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@" ; \
Stephen Rothwellb71dca92020-08-12 18:10:35 +100021 $(BASH) $(srctree)/arch/powerpc/tools/unrel_branch_check.sh "$(OBJDUMP)" "$(NM)" "$@"
Nicholas Piggin4ea80652017-05-12 03:40:38 +100022else
23 cmd_relocs_check = \
Alexandre Ghiti43e76cd2020-01-18 12:03:35 -050024 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@"
Nicholas Piggin4ea80652017-05-12 03:40:38 +100025endif
Nicholas Pigginf188d052016-11-26 14:26:09 +110026
27# `@true` prevents complaint when there is nothing to be done
28
29vmlinux: FORCE
30 @true
Nicholas Pigginc494ade2017-05-12 03:40:39 +100031ifdef CONFIG_PPC64
32 $(call cmd,head_check)
33endif
Nicholas Pigginf188d052016-11-26 14:26:09 +110034ifdef CONFIG_RELOCATABLE
35 $(call if_changed,relocs_check)
36endif
37
38%.ko: FORCE
39 @true
40
41clean:
Nicholas Pigginc494ade2017-05-12 03:40:39 +100042 rm -f .tmp_symbols.txt
Nicholas Pigginf188d052016-11-26 14:26:09 +110043
44PHONY += FORCE clean
45
46FORCE:
47
48.PHONY: $(PHONY)