linux查看动态库/程序依赖的库


objdump命令

# 查看依赖的库
objdump -x xxx.so | grep NEEDED

# 查看可执行程序依赖的库
objdump -x ./testTime | grep NEEDED

readelf命令

# 查看依赖的库
readelf -a xxx.so | grep "Shared"

# 查看可执行程序依赖的库
readelf -a ./testTime | grep "Shared"

# 查看依赖的库
readelf -d xxx.so
readelf -d ./testTime

# 查看静态库有哪些.o文件
readelf -d xxx.a

ldd命令

# 查看依赖的库
ldd xxx.so

# 查看可执行程序依赖的库
ldd ./testTime

在服务端查看哪些进程在使用某一个so

lsof  ***.so

参考资料

https://www.cnblogs.com/liushuhe1990/p/9876600.html
https://www.cnblogs.com/silentdoer/p/11748567.html

发布了66 篇原创文章 · 获赞 49 · 访问量 9万+

猜你喜欢

转载自blog.csdn.net/mayue_web/article/details/104019036