La herramienta estándar para los símbolos en la lista es nm
, se puede usar simplemente como esto:
nm -g yourLib.so
Si usted quiere ver los símbolos de una biblioteca de C++, agregue la opción "-C", que demangle los símbolos (es mucho más legible exigido).
nm -gC yourLib.so
Si el archivo .so está en formato ELF, tiene dos opciones:
De cualquier objdump
(-C
es también útil para el desenredo C++):
$ objdump -TC libz.so
libz.so: file format elf64-x86-64
DYNAMIC SYMBOL TABLE:
0000000000002010 l d .init 0000000000000000 .init
0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 free
0000000000000000 DF *UND* 0000000000000000 GLIBC_2.2.5 __errno_location
0000000000000000 w D *UND* 0000000000000000 _ITM_deregisterTMCloneTable
O utilice readelf
:
$ readelf -Ws libz.so
Symbol table '.dynsym' contains 112 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 0000000000000000 0 NOTYPE LOCAL DEFAULT UND
1: 0000000000002010 0 SECTION LOCAL DEFAULT 10
2: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [email protected]_2.2.5 (14)
3: 0000000000000000 0 FUNC GLOBAL DEFAULT UND [email protected]_2.2.5 (14)
4: 0000000000000000 0 NOTYPE WEAK DEFAULT UND _ITM_deregisterTMCloneTable
La plataforma hace la diferencia. Apple proporciona un GCC 4.0, pero su 'nm' no responde a algunas opciones, como' -D' y '-g' (IIRC). – jww
Esto no imprime nada en Mac OS. –
@jww porque eso es BSD 'nm', no GNU' nm'. – OrangeDog