aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorNicholas Piggin <npiggin@gmail.com>2016-08-24 08:29:21 -0400
committerMichal Marek <mmarek@suse.com>2016-09-09 04:47:00 -0400
commitfbe6e37dab974dd0fc3660c001895f7bfd771c9a (patch)
treeb50892eb57f9e567e6f9293d1c1c6a7b94f3255f /scripts
parentb67067f1176df6ee727450546b58704e4b588563 (diff)
kbuild: add arch specific post-link Makefile
Allow architectures to create arch/xxx/Makefile.postlink with targets for vmlinux, modules.ko, and clean, which will be invoked after final linking of vmlinux and modules. powerpc will use this to check vmlinux linker relocations for sanity, and may use it to fix up alternate instruction patch branch addresses. Signed-off-by: Nicholas Piggin <npiggin@gmail.com> Signed-off-by: Michal Marek <mmarek@suse.com>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.modpost14
1 files changed, 9 insertions, 5 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index 1366a94b6c39..16923ba4b5b1 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -115,14 +115,18 @@ $(modules:.ko=.mod.o): %.mod.o: %.mod.c FORCE
115 115
116targets += $(modules:.ko=.mod.o) 116targets += $(modules:.ko=.mod.o)
117 117
118# Step 6), final link of the modules 118ARCH_POSTLINK := $(wildcard $(srctree)/arch/$(SRCARCH)/Makefile.postlink)
119
120# Step 6), final link of the modules with optional arch pass after final link
119quiet_cmd_ld_ko_o = LD [M] $@ 121quiet_cmd_ld_ko_o = LD [M] $@
120 cmd_ld_ko_o = $(LD) -r $(LDFLAGS) \ 122 cmd_ld_ko_o = \
121 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \ 123 $(LD) -r $(LDFLAGS) \
122 -o $@ $(filter-out FORCE,$^) 124 $(KBUILD_LDFLAGS_MODULE) $(LDFLAGS_MODULE) \
125 -o $@ $(filter-out FORCE,$^) ; \
126 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true)
123 127
124$(modules): %.ko :%.o %.mod.o FORCE 128$(modules): %.ko :%.o %.mod.o FORCE
125 $(call if_changed,ld_ko_o) 129 +$(call if_changed,ld_ko_o)
126 130
127targets += $(modules) 131targets += $(modules)
128 132