如何显示动态库的的依赖关系

X86环境下:


root@192.168.1.197:/usr/bin#ldd /usr/lib/libglib-2.0.so
    linux-gate.so.1 =>  (0x00ccc000)
    libpcre.so.3 => /lib/libpcre.so.3 (0x00110000)
    libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0x0054a000)
    /lib/ld-linux.so.2 (0x00840000)


ARM环境下,显示交叉编译出来的的动态共享库的依赖关系


root@192.168.1.197:/root/Qt/output/qt-arm/lib#arm-none-linux-gnueabi-readelf -d libQtCore.so

Dynamic section at offset 0x2b1260 contains 33 entries:
  Tag        Type                         Name/Value
 0x00000001 (NEEDED)                     Shared library: [libts-0.0.so.0]
 0x00000001 (NEEDED)                     Shared library: [librt.so.1]
 0x00000001 (NEEDED)                     Shared library: [libpthread.so.0]
 0x00000001 (NEEDED)                     Shared library: [libdl.so.2]
 0x00000001 (NEEDED)                     Shared library: [libstdc++.so.6]
 0x00000001 (NEEDED)                     Shared library: [libm.so.6]
 0x00000001 (NEEDED)                     Shared library: [libgcc_s.so.1]
 0x00000001 (NEEDED)                     Shared library: [libc.so.6]
 0x0000000e (SONAME)                     Library soname: [libQtCore.so.4]
 0x0000000f (RPATH)                      Library rpath: [/root/Qt/output/qt-arm/lib]
 0x0000000c (INIT)                       0x68c6c
 0x0000000d (FINI)                       0x1dfaf4
 0x00000019 (INIT_ARRAY)                 0x2b3000
 0x0000001b (INIT_ARRAYSZ)               12 (bytes)
 0x0000001a (FINI_ARRAY)                 0x2b300c
 0x0000001c (FINI_ARRAYSZ)               4 (bytes)
 0x00000004 (HASH)                       0x114
 0x00000005 (STRTAB)                     0x20dd4
 0x00000006 (SYMTAB)                     0x83a4
 0x0000000a (STRSZ)                      227242 (bytes)
 0x0000000b (SYMENT)                     16 (bytes)
 0x00000003 (PLTGOT)                     0x2b9388
 0x00000002 (PLTRELSZ)                   23984 (bytes)
 0x00000014 (PLTREL)                     REL
 0x00000017 (JMPREL)                     0x62ebc
 0x00000011 (REL)                        0x5b7c4
 0x00000012 (RELSZ)                      30456 (bytes)
 0x00000013 (RELENT)                     8 (bytes)
 0x6ffffffe (VERNEED)                    0x5b6c4
 0x6fffffff (VERNEEDNUM)                 7
 0x6ffffff0 (VERSYM)                     0x5857e
 0x6ffffffa (RELCOUNT)                   787
 0x00000000 (NULL)                       0x0
root@192.168.1.197:/root/Qt/output/qt-arm/lib#


显示依赖关系的命令 ***readelf  和交叉编译器有关:

或用 arm-linux-readelf    -d    *.so



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值