• Kai Germaschewski's avatar
    kbuild/modules: Record versions for unresolved symbols · dcc38eae
    Kai Germaschewski authored
    In the case of CONFIG_MODVERSIONING, the build step will only
    generate preliminary <module>.o objects, and an additional
    postprocessing step is necessary to record the versions of the unresolved
    symbols and add them into the final <module>.ko
      
    The version information for unresolved symbols is again recorded into
    a special section, "__versions", which contains an array of symbol
    name strings and checksum (struct modversion_info). Size is here not
    an issue, since this section will not be stored permanently in kernel
    memory.
      
    Makefile.modver takes care of the following steps:
    o Collect the version information for all exported symbols from vmlinux
      and all modules which export symbols.
    o For each module, generate a C file which contains the modversion
      information for all unresolved symbols in that module.
    o For each module, compile that C file to an object file
    o Finally, link the <module>.ko using the preliminary <module.o> + the
      version information above.
      
    The first two steps are currently done by not very efficient scripting,
    so there's room for performance improvement using some helper C code.
    dcc38eae
Makefile 27.2 KB