如何判断一个库是否是用 -g 编译的? [英] How can I tell if a library was compiled with -g?
本文介绍了如何判断一个库是否是用 -g 编译的?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我在 x86 Linux 上有一些已编译的库,我想快速确定它们是否是使用调试符号编译的.
I have some compiled libraries on x86 Linux and I want to quickly determine whether they were compiled with debugging symbols.
推荐答案
如果您在 Linux 上运行,请使用 objdump --debugging
.库中的每个目标文件都应该有一个条目.对于没有调试符号的目标文件,您将看到如下内容:
If you're running on Linux, use objdump --debugging
. There should be an entry for each object file in the library. For object files without debugging symbols, you'll see something like:
objdump --debugging libvoidincr.a
In archive libvoidincr.a:
voidincr.o: file format elf64-x86-64
如果有调试符号,输出会更加冗长.
If there are debugging symbols, the output will be much more verbose.
这篇关于如何判断一个库是否是用 -g 编译的?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文