Genksyms
reads (on standard input) the output from
gcc -E source.c
and generates a file containing version information.
Depending on the output format indicated by the
-k
option, the output will either be written to a .ver file in the named
output directory, or to the standard output.
Genksyms
normally looks for explicit symbol table definitions in the source
file. All definitions and declarations of
typedef, struct, union
and
enum
will be saved for later expansion.
Every global symbol will also be saved, together with pointers
that will enable a full expansion later on.
When a symbol table is found in the source, the symbol will be
expanded to its full definition, where all struct's, unions, enums
and typedefs will be expanded down to their basic part, recursively.
This final string will then be used as input to a CRC algorithm
that will give an integer that will change as soon as any of the
included definitions changes, for this symbol.
The version information in the kernel normally looks like:
symbol_R12345678,
where 12345678 is the hexadicimal representation of the CRC.