Skip to content

Commit

Permalink
modpost: show warning if vmlinux is not found when processing modules
Browse files Browse the repository at this point in the history
check_exports() does not print warnings about unresolved symbols if
vmlinux is missing because there would be too many.

This situation happens when you do 'make modules' from the clean
tree, or compile external modules against a kernel tree that has
not been completely built.

It is dangerous to not check unresolved symbols because you might be
building useless modules. At least it should be warned.

Signed-off-by: Masahiro Yamada <[email protected]>
  • Loading branch information
masahir0y committed Jun 6, 2020
1 parent 436b2ac commit 7e8a323
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -2001,8 +2001,6 @@ static void read_symbols(const char *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)) {
have_vmlinux = 1;
mod->skip = 1;
Expand Down Expand Up @@ -2623,6 +2621,13 @@ int main(int argc, char **argv)
if (files_source)
read_symbols_from_files(files_source);

/*
* When there's no vmlinux, don't print warnings about
* unresolved symbols (since there'll be too many ;)
*/
if (!have_vmlinux)
warn("Symbol info of vmlinux is missing. Unresolved symbol check will be entirely skipped.\n");

err = 0;

for (mod = modules; mod; mod = mod->next) {
Expand Down

0 comments on commit 7e8a323

Please sign in to comment.