summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'scripts')
-rw-r--r--scripts/Makefile.build9
1 files changed, 7 insertions, 2 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build
index db38ef465a63..67fb4530a6ff 100644
--- a/scripts/Makefile.build
+++ b/scripts/Makefile.build
@@ -103,6 +103,10 @@ ifneq ($(KBUILD_CHECKSRC),0)
endif
endif
+# Do section mismatch analysis for each module/built-in.o
+ifdef CONFIG_DEBUG_SECTION_MISMATCH
+ cmd_secanalysis = ; scripts/mod/modpost $@
+endif
# Compile C sources (.c)
# ---------------------------------------------------------------------------
@@ -268,7 +272,8 @@ ifdef builtin-target
quiet_cmd_link_o_target = LD $@
# If the list of objects to link is empty, just create an empty built-in.o
cmd_link_o_target = $(if $(strip $(obj-y)),\
- $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^),\
+ $(LD) $(ld_flags) -r -o $@ $(filter $(obj-y), $^) \
+ $(cmd_secanalysis),\
rm -f $@; $(AR) rcs $@)
$(builtin-target): $(obj-y) FORCE
@@ -316,7 +321,7 @@ $($(subst $(obj)/,,$(@:.o=-objs))) \
$($(subst $(obj)/,,$(@:.o=-y)))), $^)
quiet_cmd_link_multi-y = LD $@
-cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps)
+cmd_link_multi-y = $(LD) $(ld_flags) -r -o $@ $(link_multi_deps) $(cmd_secanalysis)
quiet_cmd_link_multi-m = LD [M] $@
cmd_link_multi-m = $(cmd_link_multi-y)