1b2441318SGreg Kroah-Hartman# SPDX-License-Identifier: GPL-2.0
2f188d052SNicholas Piggin# ===========================================================================
3f188d052SNicholas Piggin# Post-link powerpc pass
4f188d052SNicholas Piggin# ===========================================================================
5f188d052SNicholas Piggin#
6f188d052SNicholas Piggin# 1. Check that vmlinux relocations look sane
7f188d052SNicholas Piggin
8f188d052SNicholas PigginPHONY := __archpost
9f188d052SNicholas Piggin__archpost:
10f188d052SNicholas Piggin
1124e0bfbfSHoria Geantă-include include/config/auto.conf
12f188d052SNicholas Piggininclude scripts/Kbuild.include
13f188d052SNicholas Piggin
14c494adefSNicholas Pigginquiet_cmd_head_check = CHKHEAD $@
15c494adefSNicholas Piggin      cmd_head_check = $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/head_check.sh "$(NM)" "$@"
16c494adefSNicholas Piggin
17f188d052SNicholas Pigginquiet_cmd_relocs_check = CHKREL  $@
184ea80652SNicholas Pigginifdef CONFIG_PPC_BOOK3S_64
194ea80652SNicholas Piggin      cmd_relocs_check =						\
204ea80652SNicholas Piggin	$(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$@" ; \
21858805b3SMasahiro Yamada	$(BASH) $(srctree)/arch/powerpc/tools/unrel_branch_check.sh "$(OBJDUMP)" "$@"
224ea80652SNicholas Pigginelse
234ea80652SNicholas Piggin      cmd_relocs_check =						\
244ea80652SNicholas Piggin	$(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$@"
254ea80652SNicholas Pigginendif
26f188d052SNicholas Piggin
27f188d052SNicholas Piggin# `@true` prevents complaint when there is nothing to be done
28f188d052SNicholas Piggin
29f188d052SNicholas Pigginvmlinux: FORCE
30f188d052SNicholas Piggin	@true
31c494adefSNicholas Pigginifdef CONFIG_PPC64
32c494adefSNicholas Piggin	$(call cmd,head_check)
33c494adefSNicholas Pigginendif
34f188d052SNicholas Pigginifdef CONFIG_RELOCATABLE
35f188d052SNicholas Piggin	$(call if_changed,relocs_check)
36f188d052SNicholas Pigginendif
37f188d052SNicholas Piggin
38f188d052SNicholas Piggin%.ko: FORCE
39f188d052SNicholas Piggin	@true
40f188d052SNicholas Piggin
41f188d052SNicholas Pigginclean:
42c494adefSNicholas Piggin	rm -f .tmp_symbols.txt
43f188d052SNicholas Piggin
44f188d052SNicholas PigginPHONY += FORCE clean
45f188d052SNicholas Piggin
46f188d052SNicholas PigginFORCE:
47f188d052SNicholas Piggin
48f188d052SNicholas Piggin.PHONY: $(PHONY)
49