Commit 6ab26f0a authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] Fix More Problems Introduced By Module Structure Added in modpost.c

From: Rusty Russell <rusty@rustcorp.com.au>

Sam Ravnborg found these.

1) have_vmlinux is a global, and should not be reset every time.

2) We pretend every module needs cleanup_module so it gets versioned,
   but that isn't defined for CONFIG_MODULE_UNLOAD=n.

3) The visible effect of this is that modpost will start complaning about
   undefined symbols - previously this happened only when the module was
   isntalled.
parent 23868940
......@@ -390,14 +390,20 @@ 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 ;) */
have_vmlinux = is_vmlinux(modname);
parse_elf(&info, modname);
mod = new_module(modname);
/* When there's no vmlinux, don't print warnings about
* unresolved symbols (since there'll be too many ;) */
if (is_vmlinux(modname)) {
unsigned int fake_crc = 0;
have_vmlinux = 1;
/* May not have this if !CONFIG_MODULE_UNLOAD: fake it.
If it appears, we'll get the real CRC. */
add_exported_symbol("cleanup_module", mod, &fake_crc);
}
for (sym = info.symtab_start; sym < info.symtab_stop; sym++) {
symname = info.strtab + sym->st_name;
......
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