Greg Kroah-Hartman | b244131 | 2017-11-01 15:07:57 +0100 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
Nicholas Piggin | f188d05 | 2016-11-26 14:26:09 +1100 | [diff] [blame] | 2 | # =========================================================================== |
| 3 | # Post-link powerpc pass |
| 4 | # =========================================================================== |
| 5 | # |
| 6 | # 1. Check that vmlinux relocations look sane |
| 7 | |
| 8 | PHONY := __archpost |
| 9 | __archpost: |
| 10 | |
Horia Geantă | 24e0bfb | 2017-05-08 11:50:16 +0300 | [diff] [blame] | 11 | -include include/config/auto.conf |
Nicholas Piggin | f188d05 | 2016-11-26 14:26:09 +1100 | [diff] [blame] | 12 | include scripts/Kbuild.include |
| 13 | |
Nicholas Piggin | c494ade | 2017-05-12 03:40:39 +1000 | [diff] [blame] | 14 | quiet_cmd_head_check = CHKHEAD $@ |
| 15 | cmd_head_check = $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/head_check.sh "$(NM)" "$@" |
| 16 | |
Nicholas Piggin | f188d05 | 2016-11-26 14:26:09 +1100 | [diff] [blame] | 17 | quiet_cmd_relocs_check = CHKREL $@ |
Nicholas Piggin | 4ea8065 | 2017-05-12 03:40:38 +1000 | [diff] [blame] | 18 | ifdef CONFIG_PPC_BOOK3S_64 |
| 19 | cmd_relocs_check = \ |
Alexandre Ghiti | 43e76cd | 2020-01-18 12:03:35 -0500 | [diff] [blame] | 20 | $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@" ; \ |
Stephen Rothwell | b71dca9 | 2020-08-12 18:10:35 +1000 | [diff] [blame] | 21 | $(BASH) $(srctree)/arch/powerpc/tools/unrel_branch_check.sh "$(OBJDUMP)" "$(NM)" "$@" |
Nicholas Piggin | 4ea8065 | 2017-05-12 03:40:38 +1000 | [diff] [blame] | 22 | else |
| 23 | cmd_relocs_check = \ |
Alexandre Ghiti | 43e76cd | 2020-01-18 12:03:35 -0500 | [diff] [blame] | 24 | $(CONFIG_SHELL) $(srctree)/arch/powerpc/tools/relocs_check.sh "$(OBJDUMP)" "$(NM)" "$@" |
Nicholas Piggin | 4ea8065 | 2017-05-12 03:40:38 +1000 | [diff] [blame] | 25 | endif |
Nicholas Piggin | f188d05 | 2016-11-26 14:26:09 +1100 | [diff] [blame] | 26 | |
| 27 | # `@true` prevents complaint when there is nothing to be done |
| 28 | |
| 29 | vmlinux: FORCE |
| 30 | @true |
Nicholas Piggin | c494ade | 2017-05-12 03:40:39 +1000 | [diff] [blame] | 31 | ifdef CONFIG_PPC64 |
| 32 | $(call cmd,head_check) |
| 33 | endif |
Nicholas Piggin | f188d05 | 2016-11-26 14:26:09 +1100 | [diff] [blame] | 34 | ifdef CONFIG_RELOCATABLE |
| 35 | $(call if_changed,relocs_check) |
| 36 | endif |
| 37 | |
| 38 | %.ko: FORCE |
| 39 | @true |
| 40 | |
| 41 | clean: |
Nicholas Piggin | c494ade | 2017-05-12 03:40:39 +1000 | [diff] [blame] | 42 | rm -f .tmp_symbols.txt |
Nicholas Piggin | f188d05 | 2016-11-26 14:26:09 +1100 | [diff] [blame] | 43 | |
| 44 | PHONY += FORCE clean |
| 45 | |
| 46 | FORCE: |
| 47 | |
| 48 | .PHONY: $(PHONY) |