Score:0

why is /bin/ls linking to libpthread?

cn flag

so strange, is ls multi-threaded somehow? what could ls possibly need libpthread for?

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)
Score:6
us flag

It's not ls itself that depends on libpthread. Use lddtree from pax-utils (sudo apt install pax-utils) to see the dependency tree:

# 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 shows all shared libraries that the file links to, including indirect dependencies.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.