Ldd

From Linuxintro
Revision as of 09:35, 24 May 2009 by imported>ThorstenStaerk

ldd shows which libraries are used by an executable file.

Example
itchy:~ # ldd /usr/local/bin/ktimetracker 
        linux-vdso.so.1 =>  (0x00007fffdb7ff000)
        libkutils.so.4 => /usr/local/lib64/libkutils.so.4 (0x00007feed334b000)
        libkparts.so.4 => /usr/local/lib64/libkparts.so.4 (0x00007feed30fa000)
        libkcal.so.4 => /usr/local/lib64/libkcal.so.4 (0x00007feed2dd7000)    
        [...]

In this case, libkutils is loaded from /usr/local/lib64/libkutils.so.4 to memory address 0x00007feed334b000.

Usage

To find out all files that an executable file depends on:

ldd /usr/local/bin/ktimetracker | sed "s/^.* => //" | sed "s/ (0x.*//"

See also

ldd's man page