-   Linux - Kernel (
-   -   undefined reference to `__this_module (

Blaider 12-25-2012 02:53 AM

undefined reference to `__this_module
when I add my PCI driver to the kernel.
I build my driver as module it's ok.but when I want to build it into the shows errors as flow:

drivers/built-in.o(.init.text+0x52c4): undefined reference to `__this_module

what should I do to avoid the error!

smallpond 12-27-2012 03:06 PM

insmod defines that value during loading. If you build it into the kernel it is not defined because you do not have a "struct module" which it points to.

Deep Narayan Dubey 12-28-2012 11:37 PM

Did you change makefile to include your new module as build target? If yes, please give the details of Makefile and directory structure for module.

Blaider 04-02-2014 02:40 AM

my colleague has defined "#define MODULE" in the header can build into the kernel correctly when I remove this code,
thanks every one here!

All times are GMT -5. The time now is 02:38 PM.