aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2007-07-20 16:36:56 -0400
committerSam Ravnborg <sam@ravnborg.org>2007-07-25 15:14:15 -0400
commit8d8d8289df65cb116d2721becafb37272074f25a (patch)
tree388c4be27f36df9a1c4c60f8642dae74b3291af9
parent80492cc797ea15572de8eac766cbf606626ee338 (diff)
kbuild: do not do section mismatch checks on vmlinux in 2nd pass
We already check and warn about section mismatches from vmlinux (build as vmlinux.o) during first pass so skip the checks during the 2nd pass where we process modules. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
-rw-r--r--scripts/Makefile.modpost19
-rw-r--r--scripts/mod/modpost.c13
2 files changed, 20 insertions, 12 deletions
diff --git a/scripts/Makefile.modpost b/scripts/Makefile.modpost
index c6fcc597b3be..1818c502007e 100644
--- a/scripts/Makefile.modpost
+++ b/scripts/Makefile.modpost
@@ -56,23 +56,24 @@ _modpost: $(if $(KBUILD_MODPOST_NOFINAL), $(modules:.ko:.o),$(modules))
56 56
57# Step 2), invoke modpost 57# Step 2), invoke modpost
58# Includes step 3,4 58# Includes step 3,4
59modpost = scripts/mod/modpost \
60 $(if $(CONFIG_MODVERSIONS),-m) \
61 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
62 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
63 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
64 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
65 $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
66
59quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules 67quiet_cmd_modpost = MODPOST $(words $(filter-out vmlinux FORCE, $^)) modules
60 cmd_modpost = scripts/mod/modpost \ 68 cmd_modpost = $(modpost) -s
61 $(if $(CONFIG_MODVERSIONS),-m) \
62 $(if $(CONFIG_MODULE_SRCVERSION_ALL),-a,) \
63 $(if $(KBUILD_EXTMOD),-i,-o) $(kernelsymfile) \
64 $(if $(KBUILD_EXTMOD),-I $(modulesymfile)) \
65 $(if $(KBUILD_EXTMOD),-o $(modulesymfile)) \
66 $(if $(KBUILD_EXTMOD)$(KBUILD_MODPOST_WARN),-w)
67 69
68PHONY += __modpost 70PHONY += __modpost
69__modpost: $(modules:.ko=.o) FORCE 71__modpost: $(modules:.ko=.o) FORCE
70 $(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^) 72 $(call cmd,modpost) $(wildcard vmlinux) $(filter-out FORCE,$^)
71 73
72quiet_cmd_kernel-mod = MODPOST $@ 74quiet_cmd_kernel-mod = MODPOST $@
73 cmd_kernel-mod = $(cmd_modpost) $@ 75 cmd_kernel-mod = $(modpost) $@
74 76
75PHONY += vmlinux
76vmlinux.o: FORCE 77vmlinux.o: FORCE
77 $(call cmd,kernel-mod) 78 $(call cmd,kernel-mod)
78 79
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 5ab7914d30ef..87e3ee56e87d 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -23,6 +23,8 @@ int have_vmlinux = 0;
23static int all_versions = 0; 23static int all_versions = 0;
24/* If we are modposting external module set to 1 */ 24/* If we are modposting external module set to 1 */
25static int external_module = 0; 25static int external_module = 0;
26/* Warn about section mismatch in vmlinux if set to 1 */
27static int vmlinux_section_warnings = 1;
26/* Only warn about unresolved symbols */ 28/* Only warn about unresolved symbols */
27static int warn_unresolved = 0; 29static int warn_unresolved = 0;
28/* How a symbol is exported */ 30/* How a symbol is exported */
@@ -1257,8 +1259,10 @@ static void read_symbols(char *modname)
1257 handle_modversions(mod, &info, sym, symname); 1259 handle_modversions(mod, &info, sym, symname);
1258 handle_moddevtable(mod, &info, sym, symname); 1260 handle_moddevtable(mod, &info, sym, symname);
1259 } 1261 }
1260 check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok); 1262 if (is_vmlinux(modname) && vmlinux_section_warnings) {
1261 check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok); 1263 check_sec_ref(mod, modname, &info, init_section, init_section_ref_ok);
1264 check_sec_ref(mod, modname, &info, exit_section, exit_section_ref_ok);
1265 }
1262 1266
1263 version = get_modinfo(info.modinfo, info.modinfo_len, "version"); 1267 version = get_modinfo(info.modinfo, info.modinfo_len, "version");
1264 if (version) 1268 if (version)
@@ -1626,7 +1630,7 @@ int main(int argc, char **argv)
1626 int opt; 1630 int opt;
1627 int err; 1631 int err;
1628 1632
1629 while ((opt = getopt(argc, argv, "i:I:mo:aw")) != -1) { 1633 while ((opt = getopt(argc, argv, "i:I:mso:aw")) != -1) {
1630 switch(opt) { 1634 switch(opt) {
1631 case 'i': 1635 case 'i':
1632 kernel_read = optarg; 1636 kernel_read = optarg;
@@ -1644,6 +1648,9 @@ int main(int argc, char **argv)
1644 case 'a': 1648 case 'a':
1645 all_versions = 1; 1649 all_versions = 1;
1646 break; 1650 break;
1651 case 's':
1652 vmlinux_section_warnings = 0;
1653 break;
1647 case 'w': 1654 case 'w':
1648 warn_unresolved = 1; 1655 warn_unresolved = 1;
1649 break; 1656 break;