CRC calculation in Module.symvers
shakthimaan at gmail.com
Tue Sep 6 03:11:24 EDT 2011
I would like to know as to:
1. How the CRC is computed for an exported symbol in the Linux kernel, and
2. Given a kernel .c file, how can I obtain the CRC checksums for a symbol.
For linux-3.0.2 (example), I compiled with CONFIG_MODVERSIONS=y, and
running make built vmlinux, and generated the Module.symvers file. I
believe genksyms is used to generate the CRC information.
I had referred the "Kernel Symbols and CONFIG_MODVERSIONS"
documentation  written by Mark McLoughlin. I tried the following in
the top-level kernel sources:
$ gcc -E -D__GENKSYMS__ -DCONFIG_MODVERSIONS -DEXPORT_SYMTAB
-I/tmp/linux-3.0.2/arch/x86/include | ./scripts/genksyms/genksyms
and I get the following error output:
=== Output ===
/tmp/linux-3.0.2/include/linux/jiffies.h:43:42: error: division by zero in #if
In file included from /tmp/linux-3.0.2/include/linux/tracepoint.h:19:0,
/tmp/linux-3.0.2/include/linux/rcupdate.h:160:2: error: #error
"Unknown RCU implementation specified to kernel configuration"
In file included from /tmp/linux-3.0.2/include/linux/module.h:21:0,
/tmp/linux-3.0.2/arch/x86/include/asm/module.h:59:2: error: #error
unknown processor family
=== End ===
The documentation for genksyms is old, and now there is no -k option?
Appreciate any inputs in this regard,
 Kernel Symbols and CONFIG_MODVERSIONS.
More information about the Kernelnewbies