linux kernel module linker warnings: "*** Warning: <function> [<module>] undefined!" - any way to get rid of them?

Gary picture Gary · Mar 9, 2009 · Viewed 22.6k times · Source

While compiling Linux kernel modules that depend on each other, linker gives undefined symbol warnings like

 Building modules, stage 2.
 MODPOST
*** Warning: "function_name1" [module_name] undefined!
*** Warning: "function_name2" [module_name] undefined!
*** Warning: "function_name3" [module_name] undefined!

The unresolved symbols are resolved as soon as module is inserted into kernel using insmod or modprobe. Is there any way to get rid of the linker warning, though?

I have read through 3 Google SERP's on this issue - it seems nobody knows the answer. Are these linker warnings supposed to be this way when you build a kernel module?

Answer

sinoj picture sinoj · Feb 26, 2010

Use KBUILD_EXTRA_SYMBOLS as below: KBUILD_EXTRA_SYMBOLS='your module path'/Module.symvers