I have two kernel modules (say modA and modB). modA exports a symbol with EXPORT_SYMBOL(symA)
and modB uses it. I have the header modA.h
for modA:
...
extern void symA(int param);
...
and in modB.c
:
#include "modA.h"
...
static int __init modB_init(void)
{
symA(10);
}
...
If i insmod
modB all works fine, my modB is correctly linked in the kernel and the function symA
is correctly called. However when i build modB the compiler raises a warning: symA is undefined
. An LKM is an ELF relocatable so why the compiler raises this warning? How can be this removed?
This issue (and how to compile correctly in this case) is explained in http://www.kernel.org/doc/Documentation/kbuild/modules.txt