Dan Hook Dan Hook - 1 year ago 101
C Question

How can I tell if a library was compiled with -g?

I have some compiled libraries on x86 Linux and I want to quickly determine whether they were compiled with debugging symbols.

Answer Source

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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download