threaded ls?

jjohn on 2002-10-20T00:09:16

From slashdot:

Funny. My /bin/ls (Debian unstable) is nearly 60k, yet is dynamically linked, and is even stripped. 


% ls -l /bin/ls
-rwxr-xr-x 1 root root 59592 Oct 8 20:17 /bin/ls*
 
% ldd /bin/ls
 librt.so.1 => /lib/librt.so.1 (0x40022000)
 libc.so.6 => /lib/libc.so.6 (0x40034000)
 libpthread.so.0 => /lib/libpthread.so.0 (0x40147000)
 /lib/ld-linux.so.2 => /lib/ld-linux.so.2 (0x40000000)
 
% file /bin/ls
/bin/ls: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), for GNU/Linux 2.2.0, dynamically linked (uses shared libs), stripped 

At first glance seeing that ls is linked to libthread brought beads of cold sweat to my brow. After all, ls JUST ISN'T FAST ENOUGH. Clearly, it requires a multithreaded solution. By applying a little more thought to this puzzle, I now believe the one of the other shared libraries (I'm looking at you libc) probably uses it. Any system hackers here care to comment?