From: Christoph Lameter The module subsystem cannot handle symbols that are zero. If symbols are present that have a zero value then the module resolver prints out a message that these symbols are unresolved. Cc: Mathieu Desnoyers Cc: Kay Sievers Cc: Rusty Russell Cc: Andi Kleen Signed-off-by: Andrew Morton --- kernel/module.c | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff -puN kernel/module.c~modules-handle-symbols-that-have-a-zero-value kernel/module.c --- a/kernel/module.c~modules-handle-symbols-that-have-a-zero-value +++ a/kernel/module.c @@ -284,7 +284,7 @@ static unsigned long __find_symbol(const } } DEBUGP("Failed to find symbol %s\n", name); - return 0; + return -ENOENT; } /* Search for module by name: must hold module_mutex. */ @@ -755,7 +755,7 @@ void __symbol_put(const char *symbol) const unsigned long *crc; preempt_disable(); - if (!__find_symbol(symbol, &owner, &crc, 1)) + if (IS_ERR_VALUE(__find_symbol(symbol, &owner, &crc, 1))) BUG(); module_put(owner); preempt_enable(); @@ -901,7 +901,8 @@ static inline int check_modstruct_versio const unsigned long *crc; struct module *owner; - if (!__find_symbol("struct_module", &owner, &crc, 1)) + if (IS_ERR_VALUE(__find_symbol("struct_module", + &owner, &crc, 1))) BUG(); return check_version(sechdrs, versindex, "struct_module", mod, crc); @@ -955,7 +956,7 @@ static unsigned long resolve_symbol(Elf_ or module initialization or unloading */ if (!check_version(sechdrs, versindex, name, mod, crc) || !use_module(mod, owner)) - ret = 0; + ret = -EINVAL; } return ret; } @@ -1342,14 +1343,16 @@ static int verify_export_symbols(struct const unsigned long *crc; for (i = 0; i < mod->num_syms; i++) - if (__find_symbol(mod->syms[i].name, &owner, &crc, 1)) { + if (!IS_ERR_VALUE(__find_symbol(mod->syms[i].name, + &owner, &crc, 1))) { name = mod->syms[i].name; ret = -ENOEXEC; goto dup; } for (i = 0; i < mod->num_gpl_syms; i++) - if (__find_symbol(mod->gpl_syms[i].name, &owner, &crc, 1)) { + if (!IS_ERR_VALUE(__find_symbol(mod->gpl_syms[i].name, + &owner, &crc, 1))) { name = mod->gpl_syms[i].name; ret = -ENOEXEC; goto dup; @@ -1399,7 +1402,7 @@ static int simplify_symbols(Elf_Shdr *se strtab + sym[i].st_name, mod); /* Ok if resolved. */ - if (sym[i].st_value != 0) + if (!IS_ERR_VALUE(sym[i].st_value)) break; /* Ok if weak. */ if (ELF_ST_BIND(sym[i].st_info) == STB_WEAK) _