Commit 1cc0e052 authored by Kai Germaschewski's avatar Kai Germaschewski

kbuild: Rename some module postprocessing stuff

Since it's now not only used for modversioning but generally, rename
the Makefile .modver -> .modpost and the generated files to
<module>.ver.[co].
  
Also, when there's now vmlinux during module postprocessing, don't print
warnings on unresolved symbols (there's just too many, then).
parent f864c7c2
......@@ -508,7 +508,7 @@ all: modules
.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
......
......@@ -27,7 +27,7 @@ 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
$(modules): %.ko :%.o %.mod.o FORCE
$(call if_changed,ld_ko_o)
targets += $(modules)
......@@ -40,16 +40,16 @@ quiet_cmd_cc_o_c = CC $@
# 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
$(modules:.ko=.mod.o): %.mod.o: %.mod.c include/linux/compile.h FORCE
$(call if_changed,cc_o_c)
targets += $(modules:.ko=.ver.o)
targets += $(modules:.ko=.mod.o)
# All the .ver.c files are generated using the helper "modpost"
# All the .mod.c files are generated using the helper "modpost"
.PHONY: __modpost
$(modules:.ko=.ver.c): __modpost ;
$(modules:.ko=.mod.c): __modpost ;
# Extract all checksums for all exported symbols
......
......@@ -15,6 +15,8 @@
/* Are we using CONFIG_MODVERSIONS? */
int modversions = 0;
/* Do we have vmlinux? */
int have_vmlinux = 0;
void
fatal(const char *fmt, ...)
......@@ -308,6 +310,11 @@ read_symbols(char *modname)
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);
......@@ -379,9 +386,9 @@ add_versions(struct buffer *b, struct module *mod)
for (s = mod->unres; s; s = s->next) {
exp = find_symbol(s->name);
if (!exp) {
if (have_vmlinux)
fprintf(stderr, "*** Warning: \"%s\" [%s.ko] "
"undefined!\n",
s->name, mod->name);
"undefined!\n", s->name, mod->name);
continue;
}
s->module = exp->module;
......@@ -512,7 +519,7 @@ main(int argc, char **argv)
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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment