Linux下反汇编相关工具
程序出现崩溃堆栈,如果事先没有装调试包或者以调试模式编译,则打出的堆栈中看不到函数名,或者显示 n/a
。此时往往需要根据 backtrace
打印的函数偏移地址来确定调用的是什么函数,这里就涉及到比较高级的调试技巧。
查看ELF文件信息
ldd
显示可执行文件或共享库所依赖的共享库。
Usage: ldd [OPTION]... FILE...
--help print this help and exit (获取指令帮助信息)
--version print version information and exit (打印ldd的版本号)
-d, --data-relocs process data relocations (执行重定位和报告任何丢失的对象)
-r, --function-relocs process data and function relocations (执行数据对象和函数的重定位,并且报告任何丢失的对象和函数)
-u, --unused print unused direct dependencies (打印未使用的直接依赖)
-v, --verbose print all information (详细信息模式,打印所有信息,例如包括符号的版本信息)
nm
列出库文件(.a、.lib)、目标文件(*.o)、可执行文件的符号表。