C++ 如何将符号转储到 .a 文件中
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/1203765/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
How to dump the symbols in a .a file
提问by n179911
Can you please tell me how can I dump all the symbols in a .a file on MacOS X?
你能告诉我如何在 MacOS X 上转储 .a 文件中的所有符号吗?
I am getting a linking error while compiling my c++ problem on MacOS X. I would like to find out if the sybmols exists on the .a file that I am linking with.
我在 MacOS X 上编译我的 c++ 问题时遇到链接错误。我想知道 sybmols 是否存在于我正在链接的 .a 文件中。
Thank you.
谢谢你。
回答by Sinan ünür
Nm displays the name list (symbol table) of each object file in the argument list. If an argument is an archive, a listing for each object file in the archive will be produced. File can be of the form libx.a(x.o), in which case only symbols from that member of the object file are listed. ... etc
Nm 显示参数列表中每个目标文件的名称列表(符号表)。如果参数是档案,则将生成档案中每个目标文件的列表。文件可以是 libx.a(xo) 形式,在这种情况下,只列出来自目标文件成员的符号。... 等等
回答by Tomeamis
nm -g | c++filt
nm -g | c++filt
Mac nm
doesn't have the demangle option, so you just run the output through c++filt
(a demangler) afterwards.
Macnm
没有 demangle 选项,因此您只需在c++filt
之后通过(一个 demangler)运行输出。