.PHONY: modules
modules: $(SUBDIRS) $(if $(CONFIG_MODVERSIONS),vmlinux)
@echo ' Building modules, stage 2.';
- $(Q)$(MAKE) -rR -f scripts/Makefile.modver
+ $(Q)$(MAKE) -rR -f scripts/Makefile.modpost
# Install modules
--- /dev/null
+# ===========================================================================
+# Module versions
+# ===========================================================================
+
+.PHONY: __modversions
+__modversions:
+
+include .config
+include scripts/Makefile.lib
+
+#
+
+__modules := $(shell cat /dev/null $(wildcard $(MODVERDIR)/*.mod))
+modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
+
+ifneq ($(filter-out $(modules),$(__modules)),)
+ $(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS,)
+ $(warning do not complain if something goes wrong.)
+endif
+
+__modversions: $(modules)
+ @:
+
+# The final module link
+
+quiet_cmd_ld_ko_o = LD [M] $@
+ cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
+ $(filter-out FORCE,$^)
+
+$(modules): %.ko :%.o %.mod.o FORCE
+ $(call if_changed,ld_ko_o)
+
+targets += $(modules)
+
+# Compile version info for unresolved symbols
+
+quiet_cmd_cc_o_c = CC $@
+ cmd_cc_o_c = $(CC) $(CFLAGS) $(CFLAGS_MODULE) -c -o $@ $<
+
+# We have a fake dependency on compile.h to make sure that we
+# notice if the compiler version changes under us.
+
+$(modules:.ko=.mod.o): %.mod.o: %.mod.c include/linux/compile.h FORCE
+ $(call if_changed,cc_o_c)
+
+targets += $(modules:.ko=.mod.o)
+
+# All the .mod.c files are generated using the helper "modpost"
+
+.PHONY: __modpost
+
+$(modules:.ko=.mod.c): __modpost ;
+
+# Extract all checksums for all exported symbols
+
+quiet_cmd_modpost = MODPOST
+ cmd_modpost = scripts/modpost $^
+
+__modpost: $(wildcard vmlinux) $(modules:.ko=.o)
+ $(call if_changed,modpost)
+
+targets += __modpost
+
+# Add FORCE to the prequisites of a target to force it to be always rebuilt.
+# ---------------------------------------------------------------------------
+
+.PHONY: FORCE
+
+FORCE:
+
+# Read all saved command lines and dependencies for the $(targets) we
+# may be building above, using $(if_changed{,_dep}). As an
+# optimization, we don't need to read them if the target does not
+# exist, we will rebuild anyway in that case.
+
+targets := $(wildcard $(sort $(targets)))
+cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
+
+ifneq ($(cmd_files),)
+ include $(cmd_files)
+endif
+++ /dev/null
-# ===========================================================================
-# Module versions
-# ===========================================================================
-
-.PHONY: __modversions
-__modversions:
-
-include .config
-include scripts/Makefile.lib
-
-#
-
-__modules := $(shell cat /dev/null $(wildcard $(MODVERDIR)/*.mod))
-modules := $(patsubst %.o,%.ko,$(wildcard $(__modules:.ko=.o)))
-
-ifneq ($(filter-out $(modules),$(__modules)),)
- $(warning *** Uh-oh, you have stale module entries. You messed with SUBDIRS,)
- $(warning do not complain if something goes wrong.)
-endif
-
-__modversions: $(modules)
- @:
-
-# The final module link
-
-quiet_cmd_ld_ko_o = LD [M] $@
- cmd_ld_ko_o = $(LD) $(LDFLAGS) $(LDFLAGS_MODULE) -o $@ \
- $(filter-out FORCE,$^)
-
-$(modules): %.ko :%.o %.ver.o FORCE
- $(call if_changed,ld_ko_o)
-
-targets += $(modules)
-
-# Compile version info for unresolved symbols
-
-quiet_cmd_cc_o_c = CC $@
- cmd_cc_o_c = $(CC) $(CFLAGS) $(CFLAGS_MODULE) -c -o $@ $<
-
-# We have a fake dependency on compile.h to make sure that we
-# notice if the compiler version changes under us.
-
-$(modules:.ko=.ver.o): %.ver.o: %.ver.c include/linux/compile.h FORCE
- $(call if_changed,cc_o_c)
-
-targets += $(modules:.ko=.ver.o)
-
-# All the .ver.c files are generated using the helper "modpost"
-
-.PHONY: __modpost
-
-$(modules:.ko=.ver.c): __modpost ;
-
-# Extract all checksums for all exported symbols
-
-quiet_cmd_modpost = MODPOST
- cmd_modpost = scripts/modpost $^
-
-__modpost: $(wildcard vmlinux) $(modules:.ko=.o)
- $(call if_changed,modpost)
-
-targets += __modpost
-
-# Add FORCE to the prequisites of a target to force it to be always rebuilt.
-# ---------------------------------------------------------------------------
-
-.PHONY: FORCE
-
-FORCE:
-
-# Read all saved command lines and dependencies for the $(targets) we
-# may be building above, using $(if_changed{,_dep}). As an
-# optimization, we don't need to read them if the target does not
-# exist, we will rebuild anyway in that case.
-
-targets := $(wildcard $(sort $(targets)))
-cmd_files := $(wildcard $(foreach f,$(targets),$(dir $(f)).$(notdir $(f)).cmd))
-
-ifneq ($(cmd_files),)
- include $(cmd_files)
-endif
/* Are we using CONFIG_MODVERSIONS? */
int modversions = 0;
+/* Do we have vmlinux? */
+int have_vmlinux = 0;
void
fatal(const char *fmt, ...)
struct elf_info info = { };
Elf_Sym *sym;
+ /* When there's no vmlinux, don't print warnings about
+ * unresolved symbols (since there'll be too many ;) */
+ if (strcmp(modname, "vmlinux") == 0)
+ have_vmlinux = 1;
+
parse_elf(&info, modname);
mod = new_module(modname);
for (s = mod->unres; s; s = s->next) {
exp = find_symbol(s->name);
if (!exp) {
- fprintf(stderr, "*** Warning: \"%s\" [%s.ko] "
- "undefined!\n",
- s->name, mod->name);
+ if (have_vmlinux)
+ fprintf(stderr, "*** Warning: \"%s\" [%s.ko] "
+ "undefined!\n", s->name, mod->name);
continue;
}
s->module = exp->module;
add_depends(&buf, mod, modules);
add_moddevtable(&buf, mod);
- sprintf(fname, "%s.ver.c", mod->name);
+ sprintf(fname, "%s.mod.c", mod->name);
write_if_changed(&buf, fname);
}
return 0;