Reputation: 1965
To load a module, the kernel must contain all the kernel symbols used in the module. If those symbols were not included in the kernel at compile time, the module will not be loaded due to missing dependencies.
Is this mean kernel module should be compiled with full kernel compilation to include kernel module symbols in vmlinux , If we compile module separately then we will not be able to load in kernel at run time ?
Please correct my understanding even I am asking wrong question please correct.
Upvotes: 1
Views: 124
Reputation: 22157
If I'm not mistaken, you're referring to this article: http://www.linuxjournal.com/content/kbuild-linux-kernel-build-system?page=0,0
Is this mean kernel module should be compiled with full kernel compilation to include kernel module symbols in vmlinux , If we compile module separately then we will not be able to load in kernel at run time ?
This claim referrs to kernel compilation, and not module compilation (but loading instead).
To load a module, the kernel must contain all the kernel symbols used in the module. If those symbols were not included in the kernel at compile time, the module will not be loaded due to missing dependencies.
This is not entirely true. Here's the example from The Linux Kernel Module Programming Guide
For example, msdos.ko requires the fat.ko module to be already loaded into the kernel. The requested module has a dependency on another module if the other module defines symbols (variables or functions) that the requested module uses.
So, you can still load module even though symbols were not compiled with kernel (but are provided by different module)
However, imagine that somehow you compile your kernel without printk
support. Now, every module that you try to load will try to find printk
function which simply doesn't exist. So, you need to make a reasonable decisions while compiling the kernel to include essentials that all modules that might be loaded can be loaded indeed.
Upvotes: 2