ls is huge

Jul 08, 2009 14:19

hendrik@lovesong:~$ ls -l /bin/ls
-rwxr-xr-x 1 root root 92312 2008-04-04 10:22 /bin/ls
hendrik@lovesong:~$

92K.

I remember the day when I could use ls on a 48K PDP-11 ( Read more... )

Leave a comment

Comments 4

swestrup July 8 2009, 20:58:25 UTC
Well, the last is the standard C library of course. The two before that are security libraries that can interpret funky new types of file permissions. I'm not sure what the first one is for.

Reply

sps July 8 2009, 22:32:19 UTC
I think librt is POSIX.1b, the Real Time stuff, with good things like aios and semaphores.

I must say I can't imagine why it's so large.

OTOH, when your PDP-11 will fit 10,000 times over into your video RAM, maybe a mere one or two orders of magnitude bloat seems more forgiveable? Or not.

Hey, man, that PDP-11 image just about fits in L1 cache nowadays. I guess the disk was about the scale of L3. RAM is the new tape. Now that's an interesting thought....

Reply


size ext_198092 July 10 2009, 13:58:57 UTC
You are comparing 2 totally different things : a file size vs size of the core memory of the PDP. Also, a file size is not a good hint about what will the process memory footprint be.

If you want to compare file sizes, in that case ls is OK, but you still need to maybe check for the symbol table size too, or check the executable different section sizes.

In the later case, run "size" on your a.out to get the size of the text and data sections. Regarding the share libs, you should recompile ls with -static (or something like this) to get the correct size.

Here are the numbers for PDP11 Unix V7 :

# ls -l /bin/ls
-rwxr-xr-x 1 bin 8072 Jun 8 1979 /bin/ls
# size /bin/ls
7296+760+3840 = 11896b = 027170b

Man says :

Size prints the (decimal) number of bytes required by the
text, data, and bss portions, and their sum in octal and
decimal, of each object-file argument. [...]

You may also take into account that the PDP11 "complex" addressing modes may allows shorter programs than nowadays 32 bits RISC instruction set.

Reply

Re: size hendrikboom July 10 2010, 22:47:29 UTC
hendrik@lovesong:~$ size /bin/ls
text data bss dec hex filename
88264 908 1132 90304 160c0 /bin/ls
hendrik@lovesong:~$

It looks as if a lot if it *is* code.

- hendrik

Reply


Leave a comment

Up