1# SPDX-License-Identifier: GPL-2.0 2# =========================================================================== 3# Post-link powerpc pass 4# =========================================================================== 5# 6# 1. Check that vmlinux relocations look sane 7 8PHONY := __archpost 9__archpost: 10 11-include include/config/auto.conf 12include $(srctree)/scripts/Kbuild.include 13 14quiet_cmd_head_check = CHKHEAD $@ 15 cmd_head_check = $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/head_check.sh "$(NM)" "$@" 16 17quiet_cmd_relocs_check = CHKREL $@ 18ifdef CONFIG_PPC_BOOK3S_64 19 cmd_relocs_check = \ 20 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@" ; \ 21 $(BASH) $(srctree)/arch/powerpc/tools/unrel_branch_check.sh "$(OBJDUMP)" "$(NM)" "$@" 22else 23 cmd_relocs_check = \ 24 $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@" 25endif 26 27quiet_cmd_ftrace_check = CHKFTRC $@ 28 cmd_ftrace_check = $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/ftrace_check.sh "$(NM)" "$@" 29 30# `@true` prevents complaint when there is nothing to be done 31 32vmlinux: FORCE 33 @true 34ifdef CONFIG_PPC64 35 $(call cmd,head_check) 36endif 37ifdef CONFIG_RELOCATABLE 38 $(call if_changed,relocs_check) 39endif 40ifdef CONFIG_FUNCTION_TRACER 41ifndef CONFIG_PPC64_ELF_ABI_V1 42 $(call cmd,ftrace_check) 43endif 44endif 45 46clean: 47 rm -f .tmp_symbols.txt 48 49PHONY += FORCE clean 50 51FORCE: 52 53.PHONY: $(PHONY) 54