ldd工具的使用

Dodd發表於2008-02-28

ldd工具是一個在linuxunix作業系統裡用來顯示一個執行檔案或共享庫的動態依賴資訊的。

 

ldd工具在解決類似error while loading shared libraries: libclntsh.so.9.0等錯誤是很好用。

 

下面是這個工具的用法:

 

[oracle@filesvr1 oracle]$ man ldd

LDD(1)                                                                  LDD(1)

 

NAME

       ldd - print shared library dependencies

 

SYNOPSIS

       ldd [OPTION]...  FILE...

 

DESCRIPTION

       ldd  prints  the  shared  libraries  required by each program or shared

       library specified on the command line.

 

OPTIONS

       --version

              Print the version number of ldd.

 

       -v --verbose

              Print all information, including e.g. symbol versioning informa-

              tion.

 

       -d --data-relocs

              Perform. relocations and report any missing objects (ELF only).

 

       -r --function-relocs

              Perform  relocations  for  both  data objects and functions, and

              report any missing objects or functions (ELF only).

 

       --help Usage information.

 

BUGS

       ldd does not work on a.out shared libraries.

 

       ldd does not work with some extremely old  a.out  programs  which  were

       built  before  ldd  support was added to the compiler releases.  If you

       use ldd on one of these programs, the program will attempt to run  with

       argc = 0 and the results will be unpredictable.

 

AUTHOR

       Roland McGrath and Ulrich Drepper.

 

SEE ALSO

       ldconfig(8), ld.so(8).

 

                                30 October 2000                         LDD(1)

 

[oracle@filesvr1 oracle]$ ldd /opt/oracle/product/9.2.0/bin/sqlplus

        libclntsh.so.9.0 => /opt/oracle/product/9.2.0/lib/libclntsh.so.9.0 (0xb6c19000)

        libwtc9.so => /opt/oracle/product/9.2.0/lib/libwtc9.so (0xb6c16000)

        libdl.so.2 => /lib/libdl.so.2 (0xb6c13000)

        libm.so.6 => /lib/tls/libm.so.6 (0xb6bf1000)

        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb6be0000)

        libnsl.so.1 => /lib/libnsl.so.1 (0xb6bcb000)

        libc.so.6 => /lib/tls/libc.so.6 (0xb6a93000)

        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb75eb000)

 

-v選項  包括版本資訊

       -v --verbose

              Print all information, including e.g. symbol versioning informa-

              tion.

 

 

[oracle@filesvr1 oracle]$ ldd -v /opt/oracle/product/9.2.0/bin/sqlplus

        libclntsh.so.9.0 => /opt/oracle/product/9.2.0/lib/libclntsh.so.9.0 (0xb6c19000)

        libwtc9.so => /opt/oracle/product/9.2.0/lib/libwtc9.so (0xb6c16000)

        libdl.so.2 => /lib/libdl.so.2 (0xb6c13000)

        libm.so.6 => /lib/tls/libm.so.6 (0xb6bf1000)

        libpthread.so.0 => /lib/tls/libpthread.so.0 (0xb6be0000)

        libnsl.so.1 => /lib/libnsl.so.1 (0xb6bcb000)

        libc.so.6 => /lib/tls/libc.so.6 (0xb6a93000)

        /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0xb75eb000)

 

        Version information:

        /opt/oracle/product/9.2.0/bin/sqlplus:

                libpthread.so.0 (GLIBC_2.0) => /lib/tls/libpthread.so.0

                libc.so.6 (GLIBC_2.0) => /lib/tls/libc.so.6

        /opt/oracle/product/9.2.0/lib/libclntsh.so.9.0:

                libdl.so.2 (GLIBC_2.1) => /lib/libdl.so.2

                libdl.so.2 (GLIBC_2.0) => /lib/libdl.so.2

                libm.so.6 (GLIBC_2.1) => /lib/tls/libm.so.6

                libm.so.6 (GLIBC_2.0) => /lib/tls/libm.so.6

                libpthread.so.0 (GLIBC_2.2) => /lib/tls/libpthread.so.0

                libpthread.so.0 (GLIBC_2.0) => /lib/tls/libpthread.so.0

                libpthread.so.0 (GLIBC_2.1) => /lib/tls/libpthread.so.0

                libc.so.6 (GLIBC_2.1.3) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.2) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.1.2) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.1) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.0) => /lib/tls/libc.so.6

        /opt/oracle/product/9.2.0/lib/libwtc9.so:

                libc.so.6 (GLIBC_2.0) => /lib/tls/libc.so.6

        /lib/libdl.so.2:

                libc.so.6 (GLIBC_2.3) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.1.3) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.1) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_PRIVATE) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.0) => /lib/tls/libc.so.6

                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2

        /lib/tls/libm.so.6:

                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2

                libc.so.6 (GLIBC_2.1.3) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.0) => /lib/tls/libc.so.6

        /lib/tls/libpthread.so.0:

                ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2

                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2

                libc.so.6 (GLIBC_2.1.3) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.1) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.3.2) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.0) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.2) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_PRIVATE) => /lib/tls/libc.so.6

        /lib/libnsl.so.1:

                libc.so.6 (GLIBC_2.1.3) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.2) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.2.3) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.0) => /lib/tls/libc.so.6

                libc.so.6 (GLIBC_2.1) => /lib/tls/libc.so.6

        /lib/tls/libc.so.6:

                ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2

                ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2

                ld-linux.so.2 (GLIBC_2.0) => /lib/ld-linux.so.2

                ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2

 

 

--The End--

來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/7220098/viewspace-196159/,如需轉載,請註明出處,否則將追究法律責任。