Using elfread, I could see that symbol "struct_module" is saved in the __versions section of moduleX.ko
Typo above. the tool used in readelf.
- Durga
From: Durga Prasad <writexdp@xxxxxxxxx>
To: kernelnewbies@xxxxxxxxxxxx
Sent: Wednesday, February 25, 2009 6:01:37 PM
Subject: How does EXPORT_SYMBOL work?
Hi,
I am trying to understand how module versioning works in Linux kernel.
If I have a moduleX.ko file with me, how do I determine if it would load successfully (using insmod or modprobe)? This is purely from versioning perspective. I assume that no other errors related to memory allocation, etc.
From the code, I could see the load_module () compares the CRC of the module against the CRC of "struct_module" symbol in the kernel.
When are these CRCs created. Using elfread, I could see that symbol "struct_module" is saved in the __versions section of moduleX.ko
I could not understand the EXPORT_SYMBOL code clearly. It seem to me that it creates a CRC (somehow) and saves to the kernel symbol table
(kallsyms?)
Please clarify to clear my doubt.
Thanks
Durga