- For a kernel build without CONFIG_MODVERSIONING enabled the crc
- would read: 0x00000000
-
- Module.symvers serve two purposes.
- 1) It list all exported symbols both from vmlinux and all modules
- 2) It list CRC if CONFIG_MODVERSION is enabled
-
---- 7.2 Symbols and external modules
-
- When building an external module the build system needs access to
- the symbols from the kernel to check if all external symbols are
- defined. This is done in the MODPOST step and to obtain all
- symbols modpost reads Module.symvers from the kernel.
- If a Module.symvers file is present in the directory where
- the external module is being build this file will be read too.
- During the MODPOST step a new Module.symvers file will be written
- containing all exported symbols that was not defined in the kernel.
-
---- 7.3 Symbols from another external module
-
- Sometimes one external module uses exported symbols from another
- external module. Kbuild needs to have full knowledge on all symbols
- to avoid spitting out warnings about undefined symbols.
- Two solutions exist to let kbuild know all symbols of more than
- one external module.
- The method with a top-level kbuild file is recommended but may be
- impractical in certain situations.
-
- Use a top-level Kbuild file
- If you have two modules: 'foo', 'bar' and 'foo' needs symbols
- from 'bar' then one can use a common top-level kbuild file so
- both modules are compiled in same build.
-
- Consider following directory layout:
- ./foo/ <= contains the foo module
- ./bar/ <= contains the bar module
- The top-level Kbuild file would then look like:
-
- #./Kbuild: (this file may also be named Makefile)
- obj-y := foo/ bar/
-
- Executing:
- make -C $KDIR M=`pwd`
-
- will then do the expected and compile both modules with full
- knowledge on symbols from both modules.
-
- Use an extra Module.symvers file
- When an external module is build a Module.symvers file is
- generated containing all exported symbols which are not
- defined in the kernel.
- To get access to symbols from module 'bar' one can copy the
- Module.symvers file from the compilation of the 'bar' module
- to the directory where the 'foo' module is build.
- During the module build kbuild will read the Module.symvers
- file in the directory of the external module and when the
- build is finished a new Module.symvers file is created
- containing the sum of all symbols defined and not part of the
- kernel.
-