LD_DEBUG=libs app -v
app: 是需要查看的目标文件。
执行的结果可能如下:
14290: find library=libdl.so.2 [0]; searching
14290: search cache=/etc/ld.so.cache
14290: trying file=/lib64/libdl.so.2
14290:
14290: find library=librt.so.1 [0]; searching
14290: search cache=/etc/ld.so.cache
14290: trying file=/lib64/librt.so.1
14290:
14290: find library=liblog4c.so.3 [0]; searching
14290: search cache=/etc/ld.so.cache
14290: search path=/lib64/tls/x86_64:/lib64/tls:/lib64/x86_64:/lib64:/usr/lib64/tls/x86_64:/usr/lib64/tls:/usr/lib64/x86_64:/usr/lib64 (system search path)
14290: trying file=/lib64/tls/x86_64/liblog4c.so.3
14290: trying file=/lib64/tls/liblog4c.so.3
14290: trying file=/lib64/x86_64/liblog4c.so.3
当然,如果没有文件缺失,这个命令就执行程序。