linuxchip
linuxchip

Reputation: 316

Can anybody explain about following structure

What is the use of the below structure in linux kernel? I need to know it because I need to add a variable inside this structure.

static const struct modversion_info ____versions[]

Upvotes: 2

Views: 230

Answers (1)

iabdalkader
iabdalkader

Reputation: 17312

It includes symbols referenced by the module and their checksums, when the module is inserted those symbols are checked to make sure the module is compiled for the running kernel.

On Ubnutu the kernel-headers package contains this file which has all the symbols exported by the kernel and their checksums, you should be able to find this file if you compiled your own kernel too

usr/src/linux-headers-2.6.38-generic/Module.symvers

Note, I'm not sure what you're trying to do but you shouldn't be adding symbols to your module, when you compile a module this structure is generated for you.

Upvotes: 2

Related Questions