查找动态库依赖关系(ldd)

2024年06月25日 11:28  ·  阅读 727

1、ldd(List Dynamic Dependencies)

用于列出可执行文件或动态库的依赖关系。示例如下:

# ldd libdarknet.so 
ldd: warning: you do not have execution permission for `./libdarknet.so'
	linux-vdso.so.1 =>  (0x00007ffeaa504000)
	libm.so.6 => /lib64/libm.so.6 (0x00007f3a28b43000)
	libmvec.so.1 => not found
	libcudart.so.10.0 => not found
	libcublas.so.10.0 => not found
	libcurand.so.10.0 => not found
	libcudnn.so.7 => not found
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f3a28925000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f3a28562000)
	/lib64/ld-linux-x86-64.so.2 (0x00005560bd905000)
	

# ldd /usr/bin/ls
	linux-vdso.so.1 =>  (0x00007ffec25de000)
	libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f20e5ca5000)
	libcap.so.2 => /lib64/libcap.so.2 (0x00007f20e5aa0000)
	libacl.so.1 => /lib64/libacl.so.1 (0x00007f20e5896000)
	libc.so.6 => /lib64/libc.so.6 (0x00007f20e54d3000)
	libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f20e5271000)
	libdl.so.2 => /lib64/libdl.so.2 (0x00007f20e506c000)
	/lib64/ld-linux-x86-64.so.2 (0x000055cafe923000)
	libattr.so.1 => /lib64/libattr.so.1 (0x00007f20e4e67000)
	libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f20e4c4b000)

更多命令请参照ldd --help

评论
全部评论