打印出二进制文件运行所需的链接库--ldd

ldd的作用是打印可执行二进制文件运行时所需的链接库.如:
-bash-3.00$ ldd /export/home/oracle/oracle10g/product/10.2.0/db_1/bin/sqlplus
        libsqlplus.so =>         /export/home/oracle/oracle10g/product/10.2.0/db_1/lib/libsqlplus.so
        libclntsh.so.10.1 =>     /export/home/oracle/oracle10g/product/10.2.0/db_1/lib/libclntsh.so.10.1
        libnnz10.so =>   /export/home/oracle/oracle10g/product/10.2.0/db_1/lib/libnnz10.so
        libkstat.so.1 =>         /lib/64/libkstat.so.1
        libnsl.so.1 =>   /lib/64/libnsl.so.1
        libsocket.so.1 =>        /lib/64/libsocket.so.1
        libgen.so.1 =>   /lib/64/libgen.so.1
        libdl.so.1 =>    /lib/64/libdl.so.1
        libsched.so.1 =>         /usr/lib/64/libsched.so.1
        libc.so.1 =>     /lib/64/libc.so.1
        librt.so.1 =>    /lib/64/librt.so.1
        libaio.so.1 =>   /lib/64/libaio.so.1
        libm.so.2 =>     /lib/64/libm.so.2
        libthread.so.1 =>        /lib/64/libthread.so.1
        libmp.so.2 =>    /lib/64/libmp.so.2
        libmd.so.1 =>    /lib/64/libmd.so.1
        libscf.so.1 =>   /lib/64/libscf.so.1
        libdoor.so.1 =>  /lib/64/libdoor.so.1
        libuutil.so.1 =>         /lib/64/libuutil.so.1
如果一个可执行二进制文件运行时提示找不到某某.so文件,就可以用ldd来看看这个二进制文件运行所需的链接库文件,然后再去看看LC_LIBRARY_PATH的值是否设置正确,去对应的lib目录下再去找找看.

你可能感兴趣的:(二进制)