Symbols From Another External Module
来源:互联网 发布:mac book 用什么vpn 编辑:程序博客网 时间:2024/06/05 18:41
转载说明:来自Linux内核的:Documentation/kbuild/modules.txt
说明怎么正确在模块A中使用模块B的符号。(模块A使用模块B提供的符号)
Sometimes, an external module uses exported symbols from
another external module. kbuild needs to have full knowledge of
all symbols to avoid spitting out warnings about undefined
symbols. Three solutions exist for this situation.
NOTE: 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.ko and bar.ko, where
foo.ko needs symbols from bar.ko, you can use a
common top-level kbuild file so both modules are
compiled in the same build. Consider the following
directory layout:
./foo/ <= contains foo.ko
./bar/ <= contains bar.ko
The top-level kbuild file would then look like:
#./Kbuild (or ./Makefile):
obj-y := foo/ bar/
And executing
$ make -C $KDIR M=$PWD
will then do the expected and compile both modules with
full knowledge of symbols from either module.
Use an extra Module.symvers file
When an external module is built, a Module.symvers file
is generated containing all exported symbols which are
not defined in the kernel. To get access to symbols
from bar.ko, copy the Module.symvers file from the
compilation of bar.ko to the directory where foo.ko is
built. 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.
Use "make" variable KBUILD_EXTRA_SYMBOLS
If it is impractical to copy Module.symvers from
another module, you can assign a space separated list
of files to KBUILD_EXTRA_SYMBOLS in your build file.
These files will be loaded by modpost during the
initialization of its symbol tables.
注:使用最后一种方式比较方便,如果有多个模块的信赖,在不同的Module.symvers之前使用空格来区别。
- Symbols From Another External Module
- Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
- Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
- Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load
- Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
- Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
- Stack Overflow requires external JavaScript from another domain,which is blocked or failed to load
- Stack Overflow requires external JavaScript from another domain, which is blocked or failed to load.
- Linux kernel module symbols relocation
- Boot from another disk
- External Links Module 友情链接模块
- Access Web System from external
- Unresolved external 'InternetOpenA' referenced from
- select data from another database
- [from]module.php
- Build an external module for specified kernel.
- Python unittesting: run tests in another module
- nm-list symbols from object files
- Valid Palindrome
- 线程安全的概念,实现线程安全的几种方法
- 完美解决Ubuntu下vi编辑器方向键变字母的问题
- django中使用ajax(post)进行异步请求
- 主键和外键
- Symbols From Another External Module
- Redis应用场景
- python 调用 webservice
- python httplib 模块
- 概率论--概率及性质
- 学习计划
- C# 通过WebService方式 IIS发布网站 上传文件到服务器
- 解决win8和8.1 64位版本下无法使用debug
- 【0001】【TCP链接和释放】