如何读取NM命令:NM选项-T和-U(未定义)是什么意思
How to read nm commands : What does nm options -T and -U (undefined) mean?
我有我怀疑从'libsimint.a'的链接错误。
Linker messages (if any) follow...
/home/.../simint/lib/libsimint.a(shell.c.o): In function `simint_copy_shell':
shell.c:(.text+0x126): undefined reference to `__intel_ssse3_rep_memcpy'
/home/.../simint/lib/libsimint.a(shell.c.o): In function`simint_normalize_shells':
shell.c:(.text+0x4e3): undefined reference to `__svml_pow4'
我尝试了NM命令来弄清楚它:
>> nm libsimint.a |grep __intel_ssse3_rep_memcpy
U __intel_ssse3_rep_memcpy
>> nm libsimint.a |grep simint_copy_shell
0000000000000090 T simint_copy_shell
根据我所理解的(在NM MAN的帮助(中,Simint_copy_shell函数在代码中提到,但是__intel_ssse3_rep_memcpy在其他一些库中未定义我们的libsimint。有人可以验证这一点还是添加任何澄清?谢谢
(我正在使用ICPC编译的GCC编译和链接大型代码。(
U
表示"未定义" - 对象具有对符号的引用,但没有定义
T
表示文本段中的全球定义 - 对象定义和导出符号
手册页(man nm
(列出了所有这些类型代码。
ELF符号是对某些类型的数据或代码(例如全局变量或函数(的符号引用。&quot nm&quot(名称Mangling [1](允许我们打印出精灵文件中的所有符号。在其默认调用中," nm&quot"的输出包含三列,对于每个符号,它显示以下信息,其中包含以下相同顺序:
:- 符号值:在十六进制格式中默认情况下。
- 符号类型:我们可以看到下面的一些符号类型。如果符号类型是小写,则符号通常是局部的,如果大写,则符号为全局(外部(。
- 'B&quot/&quort" b&quot:符号在BSS(块启动符号(数据部分。
- 'd&quot/&quot" d&quot:符号在初始化的数据部分中。
- 'r&quot/&quot" r&quot:符号仅在读取数据部分中。
- 't&quot/&quot" t&quot:符号在文本(代码(部分中。
- ; n&quot:符号是调试符号。
- '
- 符号名称:符号名称。版本字符串显示为符号名称的后缀。可以将版本字符串附加到>'@@&quort'>或>&quot @@&quort&quort&quort&quort&quort&quort&quort。一个版本的字符串附加了>'@@&quot'表示符号的版本;如果该版本字符串也代表该符号的默认版本,则由 @@ @@&quot'附加,这意味着当该符号被调用而无需明确指示版本时使用该符号的版本。
实用程序的示例输出" nm&quort":
$ nm 'example_program'
000005d4 t print_error_message
-------- U strlen@@GLIBC_2.4
-------- U syscall@@GLIBC_2.4
00011008 b device_list
000005f9 t send_message_to_device
000006e5 T main
...
有关更多信息,您可以参考NM [2]
相关文章:
- 编译C++时未定义的引用
- vscode g++链路故障:体系结构x86_64的未定义符号
- 如何修复此错误:未定义对"距离(浮点数,浮点数,浮点数,浮点数,浮点数)"的引用
- 我的项目不会像"undefined reference to `grpc::g_core_codegen_interface'"那样使用未定义的引用错误进行编译
- 不知道某个东西是否被忽略会引入未定义的行为吗
- 对C宏的未定义引用,但在定义它时会出现重新定义错误
- 未定义的引用在哪里
- 编译时的 CImg 库返回对"__imp_SetDIBitsToDevice"的未定义引用
- 对Py_Initialize()的未定义引用
- c++11评估顺序(未定义的行为)
- 使用mysql c++连接器的未定义引用
- 从python调用openMP共享库时,未定义opnMP函数
- 在 Mac 上使用 CMAKE 将 FFTW 和 FFTWPP 链接到项目中时未定义的符号
- Cmake 链接问题:未定义对 Button::mousePressEvent(QGraphicsSceneMouseE
- 未定义的引用 .. 使用 OpenCV 编译 C++ 代码时,从命令行
- 未定义的引用(但 nm 表示该函数存在)
- 如何读取NM命令:NM选项-T和-U(未定义)是什么意思
- nm 获取整个存档的未定义符号,而不是单独的目标文件
- LD 报告对 nm 找到的符号的未定义引用
- g++说引用是未定义的,即使' nm '列出了我的目标文件中的符号定义