一般使用者如果想了解執行程式是Static?還是Dynamic Linking,只要使用file指令即可達到此目的,如:
$ file gdb
gdb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, statically linked, not stripped
$file gdb
gdb: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.5, dynamically linked (uses shared libs), not stripped
但如果您想要知道執行程式使用了哪些Shared Library,就需要使用ldd指令,如:
$ ldd gdb
not a dynamic executable
$ ldd gdb
libncurses.so.5 => /usr/lib/libncurses.so.5 (0x002c9000)
libm.so.6 => /lib/tls/libm.so.6 (0x005fd000)
libexpat.so.0 => /usr/lib/libexpat.so.0 (0x007e6000)
libc.so.6 => /lib/tls/libc.so.6 (0x004cf000)
/lib/ld-linux.so.2 (0x004b0000)
沒有留言:
張貼留言