如何找到一个.so文件链接到多少其他.so?

时间:2013-10-22 09:47:06

标签: unix shared-libraries

如何知道或发现共享库.so文件链接到多少个其他共享库.so文件?

1 个答案:

答案 0 :(得分:2)

使用ldd查看链接器依赖项:

$ ldd /bin/ls
    linux-vdso.so.1 =>  (0x00007fff785ff000)
    libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007f577a35e000)
    librt.so.1 => /lib/x86_64-linux-gnu/librt.so.1 (0x00007f577a156000)
    libacl.so.1 => /lib/x86_64-linux-gnu/libacl.so.1 (0x00007f5779f4d000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f5779b8e000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f577998a000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f577a5a1000)
    libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007f577976c000)
    libattr.so.1 => /lib/x86_64-linux-gnu/libattr.so.1 (0x00007f5779567000)
$ ldd /lib/x86_64-linux-gnu/libselinux.so.1
    linux-vdso.so.1 =>  (0x00007fff0a2a7000)
    libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007f72bec97000)
    libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007f72be8d8000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f72bf0de000)