Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f188d052 authored by Nicholas Piggin's avatar Nicholas Piggin Committed by Michael Ellerman
Browse files

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 fbe6e37d
("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: default avatarNicholas Piggin <npiggin@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
parent 1cd6ed7c
Loading
Loading
Loading
Loading
+0 −11
Original line number Diff line number Diff line
@@ -274,17 +274,6 @@ PHONY += $(BOOT_TARGETS1) $(BOOT_TARGETS2)

boot := arch/$(ARCH)/boot

ifeq ($(CONFIG_RELOCATABLE),y)
quiet_cmd_relocs_check = CALL    $<
      cmd_relocs_check = $(CONFIG_SHELL) $< "$(OBJDUMP)" "$(obj)/vmlinux"

PHONY += relocs_check
relocs_check: arch/powerpc/relocs_check.sh vmlinux
	$(call cmd,relocs_check)

zImage: relocs_check
endif

$(BOOT_TARGETS1): vmlinux
	$(Q)$(MAKE) $(build)=$(boot) $(patsubst %,$(boot)/%,$@)
$(BOOT_TARGETS2): vmlinux
+34 −0
Original line number Diff line number Diff line
# ===========================================================================
# 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)