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 (0x00007ffff7fce000) => /lib/x86_64-linux-gnu/ (0x00007ffff7f57000) => /lib/x86_64-linux-gnu/ (0x00007ffff7d65000) => /usr/lib/x86_64-linux-gnu/ (0x00007ffff7cd2000) => /lib/x86_64-linux-gnu/ (0x00007ffff7ccc000)
    /lib64/ (0x00007ffff7fcf000) => /lib/x86_64-linux-gnu/ (0x00007ffff7ca9000)
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/ => /lib/arm-linux-gnueabihf/ => /lib/arm-linux-gnueabihf/
   => /lib/arm-linux-gnueabihf/ => /lib/arm-linux-gnueabihf/ => /lib/arm-linux-gnueabihf/ => /lib/

ldd shows all shared libraries that the file links to, including indirect dependencies.


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.