在ubuntu下有个readelf命令,
readelf -dl ***.so
就能查看(***.so、可执行程序) 还继续依赖哪些库。
至于readelf是ubuntu的工具,为啥能看xxx.so这个嵌入式arm交叉平台上的库的依赖关系我暂时还没弄清,反正能用。
例子:
helen@helen-desktop:~/lineNon/trunk/src/libypmtool$ readelf -dl libypmtool.so
Dynamic section at offset 0x35b0 contains 29 entries:
Tag Type Name/Value
0x00000001 (NEEDED) Shared library: [libm.so.6]
0x00000001 (NEEDED) Shared library: [libdl.so.2]
0x00000001 (NEEDED) Shared library: [libpthread.so.0]
0x00000001 (NEEDED) Shared library: [libiconv.so.2]
0x00000001 (NEEDED) Shared library: [libc.so.6]
0x00000001 (NEEDED) Shared library: [ld-linux-armhf.so.3]
0x0000000c (INIT) 0x169d
0x0000000d (FINI) 0x31ad
0x00000019 (INIT_ARRAY) 0xb5a4
0x0000001b (INIT_ARRAYSZ) 4 (bytes)
0x0000001a (FINI_ARRAY) 0xb5a8
0x0000001c (FINI_ARRAYSZ) 4 (bytes)
0x00000004 (HASH) 0x118
0x00000005 (STRTAB) 0xcf4
0x00000006 (SYMTAB) 0x4b4
0x0000000a (STRSZ) 1472 (bytes)
0x0000000b (SYMENT) 16 (bytes)
0x00000003 (PLTGOT) 0xb6b8
0x00000002 (PLTRELSZ) 544 (bytes)
0x00000014 (PLTREL) REL
0x00000017 (JMPREL) 0x147c
0x00000011 (REL) 0x142c
0x00000012 (RELSZ) 80 (bytes)
0x00000013 (RELENT) 8 (bytes)
0x6ffffffe (VERNEED) 0x13bc
0x6fffffff (VERNEEDNUM) 3
0x6ffffff0 (VERSYM) 0x12b4
0x6ffffffa (RELCOUNT) 3
0x00000000 (NULL) 0x0
此外还可以使用file命令来查看(***.so、可执行程序)的运行平台信息
file ***.so
例如:
helen@helen-desktop:~/lineNo1/buildshare/lib$ file libypmtool.so
libypmtool.so: ELF 32-bit LSB shared object, ARM, version 1 (SYSV), dynamically linked, stripped
helen@helen-desktop:~/lineNon/trunk/src/virtdev_1ch$ file virdev
virdev: ELF 32-bit LSB executable, ARM, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.14, not stripped