linux内核模块链接器警告:“*** Warning:< function> [< module>] undefined!“ - 以任何方式摆脱他们? [英] linux kernel module linker warnings: "*** Warning: <function> [<module>] undefined!" - any way to get rid of them?

查看:511
本文介绍了linux内核模块链接器警告:“*** Warning:< function> [< module>] undefined!“ - 以任何方式摆脱他们?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在编译依赖于彼此的Linux内核模块时,链接器会提供未定义的符号警告,例如

While compiling Linux kernel modules that depend on each other, linker gives undefined symbol warnings like

 Building modules, stage 2.
 MODPOST
*** Warning: "function_name1" [module_name] undefined!
*** Warning: "function_name2" [module_name] undefined!
*** Warning: "function_name3" [module_name] undefined!

使用insmod或modprobe将模块插入内核后,未解析的符号才会解析。有没有办法摆脱链接器警告,虽然?

The unresolved symbols are resolved as soon as module is inserted into kernel using insmod or modprobe. Is there any way to get rid of the linker warning, though?

我已经阅读了3谷歌SERP的这个问题 - 似乎没有人知道答案。在构建内核模块时,这些链接器警告是否应该是这样的?

I have read through 3 Google SERP's on this issue - it seems nobody knows the answer. Are these linker warnings supposed to be this way when you build a kernel module?

推荐答案

使用KBUILD_EXTRA_SYMBOLS如下:
KBUILD_EXTRA_SYMBOLS ='您的模块路径'/ Module.symvers

Use KBUILD_EXTRA_SYMBOLS as below: KBUILD_EXTRA_SYMBOLS='your module path'/Module.symvers

这篇关于linux内核模块链接器警告:“*** Warning:< function> [< module>] undefined!“ - 以任何方式摆脱他们?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆