加载内核模块时出现未知符号

发布于 2024-12-06 02:38:25 字数 1790 浏览 1 评论 0原文

我需要帮助理解为什么在插入模块时出现错误。我已经尝试过 没有成功。

$ 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

英雄似剑 2024-12-13 02:38:25

我已经按照 此论坛

  1. 编译scst
  2. 将生成的 Module.symvers 附加到现有的 /lib/modules//build/Module.symversHack。不知道为什么内核这样做看不到导出的符号)。
  3. scst 复制到 /lib/modules//extra
  4. depmod -a
  5. 编译lpfc_scst
  6. 插入模块 lpfc_scst 没有任何问题。

祝你今天过得愉快。

I have solved this problem as suggested on this forum:

  1. Compiled scst.
  2. Appended the generated Module.symvers to existent /lib/modules/<version>/build/Module.symvers (Hack. Do not know why the kernel did not see the exported symbols).
  3. Copied the scst to /lib/modules/<version>/extra.
  4. depmod -a.
  5. Compiled lpfc_scst.
  6. Inserted module lpfc_scst with no problems.

Have a nice day.

千紇 2024-12-13 02:38:25

如果您尝试插入一个针对内核源代码树/标头构建的模块,而这些内核源代码树/标头不是正在运行的内核的实际源代码,则最可能的原因是正在运行的内核与您构建的内核之间的某些内核配置不同。模块反对。

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

天暗了我发光 2024-12-13 02:38:25

这意味着内核不允许模块查看该变量。看起来您确实没有将变量添加到内核导出的符号列表中:

EXPORT_SYMBOL_NOVERS(scst_register_target);

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:

EXPORT_SYMBOL_NOVERS(scst_register_target);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文