真奇怪,ls 是多线程的吗?ls
libpthread 可能需要做什么?
ldd /bin/ls
linux-vdso.so.1 (0x00007ffff7fce000)
libselinux.so.1 => /lib/x86_64-linux-gnu/libselinux.so.1 (0x00007ffff7f57000)
libc.so.6 => /lib/x86_64-linux-gnu/libc.so.6 (0x00007ffff7d65000)
libpcre2-8.so.0 => /usr/lib/x86_64-linux-gnu/libpcre2-8.so.0 (0x00007ffff7cd2000)
libdl.so.2 => /lib/x86_64-linux-gnu/libdl.so.2 (0x00007ffff7ccc000)
/lib64/ld-linux-x86-64.so.2 (0x00007ffff7fcf000)
libpthread.so.0 => /lib/x86_64-linux-gnu/libpthread.so.0 (0x00007ffff7ca9000)
答案1
它ls
本身并不依赖于libpthread
。使用lddtree
从pax-utils
(sudo apt install pax-utils
)查看依赖关系树:
# lddtree /bin/ls
ls => /bin/ls (interpreter => /lib/ld-linux-armhf.so.3)
libselinux.so.1 => /lib/arm-linux-gnueabihf/libselinux.so.1
libpcre.so.3 => /lib/arm-linux-gnueabihf/libpcre.so.3
libpthread.so.0 => /lib/arm-linux-gnueabihf/libpthread.so.0
libdl.so.2 => /lib/arm-linux-gnueabihf/libdl.so.2
libc.so.6 => /lib/arm-linux-gnueabihf/libc.so.6
ld-linux-armhf.so.3 => /lib/ld-linux-armhf.so.3
ldd
显示文件链接到的所有共享库,包括间接依赖项。