Skip to content

Commit 4a67959

Browse files
brooniemasahir0y
authored andcommitted
kbuild: modpost: Explicitly warn about unprototyped symbols
One common cause of modpost version generation failures is a failure to prototype exported assembly functions - the tooling requires this for exported functions even if they are not and should not be called from C code in order to do the version mangling for symbols. Unfortunately the error message is currently rather abstruse, simply saying that "version generation failed" and even diving into the code doesn't directly show what's going on since there's several steps between the problem and it being observed. Provide an explicit hint as to the likely cause of a version generation failure to help anyone who runs into this in future more readily diagnose and fix the problem. Signed-off-by: Mark Brown <[email protected]> Signed-off-by: Masahiro Yamada <[email protected]>
1 parent 74ee585 commit 4a67959

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

scripts/mod/modpost.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -660,8 +660,11 @@ static void handle_modversion(const struct module *mod,
660660
unsigned int crc;
661661

662662
if (sym->st_shndx == SHN_UNDEF) {
663-
warn("EXPORT symbol \"%s\" [%s%s] version generation failed, symbol will not be versioned.\n",
664-
symname, mod->name, mod->is_vmlinux ? "" : ".ko");
663+
warn("EXPORT symbol \"%s\" [%s%s] version ...\n"
664+
"Is \"%s\" prototyped in <asm/asm-prototypes.h>?\n",
665+
symname, mod->name, mod->is_vmlinux ? "" : ".ko",
666+
symname);
667+
665668
return;
666669
}
667670

0 commit comments

Comments
 (0)