Home >Backend Development >C++ >How Can I List and Identify the Origin of Symbols in a .so File?
How to Identify the Symbols Within a .so File
Question: How can I enumerate the symbols exported from a shared object file (.so) and determine their origin, specifically discerning if they originate from a static library?
Answer:
The standard utility for symbol listing is nm. Utilize it as follows:
nm -gD yourLib.so
For C libraries, incorporate the "-C" option to demangle symbols, enhancing readability.
nm -gDC yourLib.so
In cases where the .so file is in elf format, two options are available:
Using objdump:
objdump -TC libz.so
Using readelf:
readelf -Ws libz.so
The above is the detailed content of How Can I List and Identify the Origin of Symbols in a .so File?. For more information, please follow other related articles on the PHP Chinese website!