From 91341d4b2c196c689acf90e9e96f28f8d5c6665f Mon Sep 17 00:00:00 2001 From: Sam Ravnborg Date: Mon, 21 Jan 2008 21:31:44 +0100 Subject: kbuild: introduce new option to enhance section mismatch analysis Setting the option DEBUG_SECTION_MISMATCH will report additional section mismatch'es but this should in the end makes it possible to get rid of all of them. See help text in lib/Kconfig.debug for details. Signed-off-by: Sam Ravnborg --- scripts/Makefile.build | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'scripts') 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) -- cgit v1.2.3