斌 顾*_*斌 顾 3 compilation vxworks
我使用IDE WindRiver Workbench编译DKM项目!它编译成功。但是“ld”命令失败,抱怨如下:
Warning: module 0x1e2f0b8 holds reference to undefined symbol __GOTT_BASE__.
Warning: module 0x1e2f0b8 holds reference to undefined symbol __GOTT_INDEX__.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Assert.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Stoul.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Getpctype.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Stderr.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Getptoupper.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Getptolower.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Stod.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Flt.
Warning: module 0x1e2f0b8 holds reference to undefined symbol _Stdout.
ld(): error loading file (errno = 0xe0005).
Run Code Online (Sandbox Code Playgroud)
您收到这些错误是因为在系统符号表中无法解析提到的符号。
来自 VxWorks 内核程序员指南 6.8,ch。16.3.7(加载问题非常有用的章节)
系统符号表用于存储系统中已安装的函数和变量的名称和地址。这具有副作用,一旦符号安装在系统符号表中,它们就可用于未来被加载的任何模块链接。此外,当尝试解析模块中未定义的符号时,加载器使用编译到目标映像中的所有全局符号,以及之前加载的模块的所有全局符号。
提示:
[...] 加载模块时必须考虑模块之间的依赖关系,以确保可以使用编译到 VxWorks 映像中的代码或已加载到系统中的模块来解析每个新模块的引用。不这样做会导致不完全解析的代码 [...]