Linux 下查看程序依赖的库

查看arm程序的依赖库

# arm-linux-readelf hello -d
Dynamic section at offset 0xf10 contains 25 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000c (INIT)                       0x82e0
 0x0000000d (FINI)                       0x847c
 0x00000019 (INIT_ARRAY)                 0x10f04
 0x0000001b (INIT_ARRAYSZ)               4 (bytes)

查看x86程序的依赖库

# ldd hell0.x86
        linux-gate.so.1 =>  (0xb77c5000)
        libc.so.6 => /lib/libc.so.6 (0xb7672000)
        /lib/ld-linux.so.2 (0xb77c6000)