Learning which libraries are used for a binary


#1

You can use ldd command to display all of the libraries which linked against a binary:

ldd /sbin/mkfs
  linux-gate.so.1 =>  (0xb7fad000)
  libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7e3a000)
  /lib/ld-linux.so.2 (0xb7fae000)

Sometimes, especially on embedded systems other than i386 architecture, there is no ldd utility. If you found this type of system and wants to learn the used libraries for a binary, you can use directly ld-linux.so.2 as below:

/lib/ld-linux.so.2 --list /sbin/mkfs
  linux-gate.so.1 =>  (0xb7fad000)
  libc.so.6 => /lib/i686/cmov/libc.so.6 (0xb7e3a000)
  /lib/ld-linux.so.2 (0xb7fae000)