Voilà quelques façons de lister les librairies partagées (les .so ou Shared Object) dont dépend un exécutable sous Linux. Comme executable je vais me baser sur la version Linux de GLSL Hacker 0.4.0.
1 – readelf
$ readelf -d ./GLSLHacker | grep NEEDED 0x0000000000000001 (NEEDED) Shared library: [libpthread.so.0] 0x0000000000000001 (NEEDED) Shared library: [libX11.so.6] 0x0000000000000001 (NEEDED) Shared library: [libGL.so.1] 0x0000000000000001 (NEEDED) Shared library: [libdl.so.2] 0x0000000000000001 (NEEDED) Shared library: [libstdc++.so.6] 0x0000000000000001 (NEEDED) Shared library: [libm.so.6] 0x0000000000000001 (NEEDED) Shared library: [libgcc_s.so.1] 0x0000000000000001 (NEEDED)
2 – ldd
$ ldd ./GLSLHacker linux-vdso.so.1 => (0x00007fff8c7d8000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ffc793a8000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007ffc79070000) libGL.so.1 => /usr/lib/libGL.so.1 (0x00007ffc78d48000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffc78b40000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007ffc78840000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007ffc78540000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007ffc78328000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffc77f68000) /lib64/ld-linux-x86-64.so.2 (0x00007ffc795e8000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007ffc77d48000) libnvidia-tls.so.313.18 => /usr/lib/tls/libnvidia-tls.so.313.18 (0x00007ffc77b40000) libnvidia-glcore.so.313.18 => /usr/lib/libnvidia-glcore.so.313.18 (0x00007ffc75638000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007ffc75420000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007ffc75218000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007ffc75010000)
Le paramètre -v nous permet d’avoir encore plus de détails:
$ ldd -v ./GLSLHacker linux-vdso.so.1 => (0x00007fffa2950000) libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007fb65b580000) libX11.so.6 => /usr/lib/x86_64-linux-gnu/libX11.so.6 (0x00007fb65b248000) libGL.so.1 => /usr/lib/libGL.so.1 (0x00007fb65af20000) libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007fb65ad18000) libstdc++.so.6 => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 (0x00007fb65aa18000) libm.so.6 => /lib/x86_64-linux-gnu/libm.so.6 (0x00007fb65a718000) libgcc_s.so.1 => /lib/x86_64-linux-gnu/libgcc_s.so.1 (0x00007fb65a500000) libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007fb65a140000) /lib64/ld-linux-x86-64.so.2 (0x00007fb65b7c0000) libxcb.so.1 => /usr/lib/x86_64-linux-gnu/libxcb.so.1 (0x00007fb659f20000) libnvidia-tls.so.313.18 => /usr/lib/tls/libnvidia-tls.so.313.18 (0x00007fb659d18000) libnvidia-glcore.so.313.18 => /usr/lib/libnvidia-glcore.so.313.18 (0x00007fb657810000) libXext.so.6 => /usr/lib/x86_64-linux-gnu/libXext.so.6 (0x00007fb6575f8000) libXau.so.6 => /usr/lib/x86_64-linux-gnu/libXau.so.6 (0x00007fb6573f0000) libXdmcp.so.6 => /usr/lib/x86_64-linux-gnu/libXdmcp.so.6 (0x00007fb6571e8000) Version information: ./GLSLHacker: libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1 libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2 libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6 libpthread.so.0 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libpthread.so.0 libstdc++.so.6 (GLIBCXX_3.4.10) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6 (GLIBCXX_3.4.14) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6 (GLIBCXX_3.4.5) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6 (CXXABI_1.3) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libstdc++.so.6 (GLIBCXX_3.4) => /usr/lib/x86_64-linux-gnu/libstdc++.so.6 libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.7) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.11) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libpthread.so.0: ld-linux-x86-64.so.2 (GLIBC_2.2.5) => /lib64/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2 libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libX11.so.6: libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2 libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.15) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/libGL.so.1: libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libdl.so.2: ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2 libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libstdc++.so.6: libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6 ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 libgcc_s.so.1 (GCC_4.2.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1 libgcc_s.so.1 (GCC_3.3) => /lib/x86_64-linux-gnu/libgcc_s.so.1 libgcc_s.so.1 (GCC_3.0) => /lib/x86_64-linux-gnu/libgcc_s.so.1 libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libm.so.6: libc.so.6 (GLIBC_PRIVATE) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libgcc_s.so.1: libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /lib/x86_64-linux-gnu/libc.so.6: ld-linux-x86-64.so.2 (GLIBC_2.3) => /lib64/ld-linux-x86-64.so.2 ld-linux-x86-64.so.2 (GLIBC_PRIVATE) => /lib64/ld-linux-x86-64.so.2 /usr/lib/x86_64-linux-gnu/libxcb.so.1: libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.2) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/tls/libnvidia-tls.so.313.18: libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/libnvidia-glcore.so.313.18: libdl.so.2 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libdl.so.2 libm.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libm.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libXext.so.6: libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.14) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libXau.so.6: libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.3.4) => /lib/x86_64-linux-gnu/libc.so.6 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6: libc.so.6 (GLIBC_2.4) => /lib/x86_64-linux-gnu/libc.so.6 libc.so.6 (GLIBC_2.2.5) => /lib/x86_64-linux-gnu/libc.so.6