今天面试被问到了,写个博客警惕下。很难受,这个指令我以前还学过。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。。
ldd —– list, dynamic, dependencies。 列出所有的动态依赖关系。
ldd—-列出程序所使用的动态函数库的信息。
ldd –version 列出ldd的版本号
[root@bogon thread_tcp]# ldd --version
ldd (GNU libc) 2.12
Copyright (C) 2010 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Written by Roland McGrath and Ulrich Drepper.
[root@bogon thread_tcp]#
ldd -v [file] 列出所有内容的详细信息。
[root@bogon thread_tcp]# ldd -v server
linux-gate.so.1 => (0x0081c000)
libpthread.so.0 => /lib/libpthread.so.0 (0x0059a000)
libc.so.6 => /lib/libc.so.6 (0x00400000)
/lib/ld-linux.so.2 (0x003de000)
Version information:
./server:
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
libpthread.so.0 (GLIBC_2.1) => /lib/libpthread.so.0
libpthread.so.0 (GLIBC_2.0) => /lib/libpthread.so.0
/lib/libpthread.so.0:
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
libc.so.6 (GLIBC_2.1.3) => /lib/libc.so.6
libc.so.6 (GLIBC_2.1) => /lib/libc.so.6
libc.so.6 (GLIBC_2.3.2) => /lib/libc.so.6
libc.so.6 (GLIBC_2.2) => /lib/libc.so.6
libc.so.6 (GLIBC_PRIVATE) => /lib/libc.so.6
libc.so.6 (GLIBC_2.0) => /lib/libc.so.6
/lib/libc.so.6:
ld-linux.so.2 (GLIBC_PRIVATE) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.3) => /lib/ld-linux.so.2
ld-linux.so.2 (GLIBC_2.1) => /lib/ld-linux.so.2
ldd -d –data-relocs
执行符号重部署,并报告缺少的目标对象(只对ELF格式适用)
ldd -r –function-relocs
对目标对象和函数执行重新部署,并报告缺少的目标对象和函数(只对ELF格式适用