加载内核模块时出现未知符号
我需要帮助理解为什么在插入模块时出现错误。我已经尝试过 这没有成功。
$ sudo modprobe lpfc_scst
FATAL: Error inserting lpfc_scst (/lib/modules/2.6.32-33-generic/extra/lpfc_scst.ko): Unknown symbol in module, or unknown parameter (see dmesg)
$ dmesg | tail
[ 1201.262842] lpfc_scst: Unknown symbol scst_register_target
[ 1201.262949] lpfc_scst: Unknown symbol lpfc_tm_term
[ 1201.263161] lpfc_scst: no symbol version for scst_register_session
[ 1201.263164] lpfc_scst: Unknown symbol scst_register_session
[ 1201.263284] lpfc_scst: no symbol version for scst_rx_mgmt_fn
[ 1201.263286] lpfc_scst: Unknown symbol scst_rx_mgmt_fn
[ 1201.263395] lpfc_scst: no symbol version for scst_unregister_session
[ 1201.263398] lpfc_scst: Unknown symbol scst_unregister_session
[ 1201.263573] lpfc_scst: no symbol version for scst_rx_data
[ 1201.263575] lpfc_scst: Unknown symbol scst_rx_data
$ cat /proc/kallsyms | grep scst_register_target
dffd2a10 r __ksymtab_scst_register_target [scst]
dffd302e r __kstrtab_scst_register_target [scst]
dffd2b34 r __kcrctab_scst_register_target [scst]
dffd2a20 r __ksymtab___scst_register_target_template_non_gpl [scst]
dffd3063 r __kstrtab___scst_register_target_template_non_gpl [scst]
dffd2b3c r __kcrctab___scst_register_target_template_non_gpl [scst]
dffd2c10 r __ksymtab___scst_register_target_template [scst]
dffd308b r __kstrtab___scst_register_target_template [scst]
dffd2de8 r __kcrctab___scst_register_target_template [scst]
dff913a0 t __scst_register_target_template [scst]
dff90dd0 T scst_register_target [scst]
dff91840 T __scst_register_target_template_non_gpl [scst]
$
非常感谢。
I need help understanding why I get an error when I insert a module. I have tried this with no success.
$ sudo modprobe lpfc_scst
FATAL: Error inserting lpfc_scst (/lib/modules/2.6.32-33-generic/extra/lpfc_scst.ko): Unknown symbol in module, or unknown parameter (see dmesg)
$ dmesg | tail
[ 1201.262842] lpfc_scst: Unknown symbol scst_register_target
[ 1201.262949] lpfc_scst: Unknown symbol lpfc_tm_term
[ 1201.263161] lpfc_scst: no symbol version for scst_register_session
[ 1201.263164] lpfc_scst: Unknown symbol scst_register_session
[ 1201.263284] lpfc_scst: no symbol version for scst_rx_mgmt_fn
[ 1201.263286] lpfc_scst: Unknown symbol scst_rx_mgmt_fn
[ 1201.263395] lpfc_scst: no symbol version for scst_unregister_session
[ 1201.263398] lpfc_scst: Unknown symbol scst_unregister_session
[ 1201.263573] lpfc_scst: no symbol version for scst_rx_data
[ 1201.263575] lpfc_scst: Unknown symbol scst_rx_data
$ cat /proc/kallsyms | grep scst_register_target
dffd2a10 r __ksymtab_scst_register_target [scst]
dffd302e r __kstrtab_scst_register_target [scst]
dffd2b34 r __kcrctab_scst_register_target [scst]
dffd2a20 r __ksymtab___scst_register_target_template_non_gpl [scst]
dffd3063 r __kstrtab___scst_register_target_template_non_gpl [scst]
dffd2b3c r __kcrctab___scst_register_target_template_non_gpl [scst]
dffd2c10 r __ksymtab___scst_register_target_template [scst]
dffd308b r __kstrtab___scst_register_target_template [scst]
dffd2de8 r __kcrctab___scst_register_target_template [scst]
dff913a0 t __scst_register_target_template [scst]
dff90dd0 T scst_register_target [scst]
dff91840 T __scst_register_target_template_non_gpl [scst]
$
Many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
我已经按照 此论坛:
scst
。Module.symvers
附加到现有的/lib/modules//build/Module.symvers
(Hack。不知道为什么内核这样做看不到导出的符号)。scst
复制到/lib/modules//extra
。depmod -a
。lpfc_scst
。lpfc_scst
没有任何问题。祝你今天过得愉快。
I have solved this problem as suggested on this forum:
scst
.Module.symvers
to existent/lib/modules/<version>/build/Module.symvers
(Hack. Do not know why the kernel did not see the exported symbols).scst
to/lib/modules/<version>/extra
.depmod -a
.lpfc_scst
.lpfc_scst
with no problems.Have a nice day.
如果您尝试插入一个针对内核源代码树/标头构建的模块,而这些内核源代码树/标头不是正在运行的内核的实际源代码,则最可能的原因是正在运行的内核与您构建的内核之间的某些内核配置不同。模块反对。
Linux 内核内部的链接器实际上除了匹配符号的符号名称之外还考虑了很多东西,包括可能的函数参数和返回值的哈希值、尝试匹配符号名称时的各种配置选项(抢占/非抢占)。我猜在你的情况下,由于不同的配置选项,它找不到正确的匹配
If you are trying to insmod a module that was build against a kernel source tree/headers that are not the actual source of the running kernel, the most likely cause is that some kernel configuration is different between the running kernel and the one you built the module against.
The linker inside the Linux kernel actually looks at a bunch of things besides the symbol name for matching symbols, including possibly a hash of the function parameter and return value, various config option (preempt / non preempt) when trying to match symbol names. I guess that in your case it does not find the right match due to different config options
这意味着内核不允许模块查看该变量。看起来您确实没有将变量添加到内核导出的符号列表中:
This means that the kernel isn't allowing modules to see that variable. It does look like you haven't added your variables to the list of symbols that the kernel exports: