On Wed, Aug 22, 2001 at 09:37:45PM -0400, Sean 'Captain Napalm' Conner wrote:
It was thus said that the Great Iggy Drougge once
stated:
Richard Erlacher skrev:
Even today's compilers demand several hundred
Kbytes for a simple
"hello-world" program on one of today's machines, while it took well fewer
than 256 bytes of executable code to print a short text string on a Z-80 or
6502.
Tell me you're just making that up. Prove it.
I just compiled the C hello world program under Linux 2.2.12 with
egcs-2.91.66 and got the following:
-rwxrwxr-x 1 spc spc 932131 Aug 22 21:32 hello
Okay, granted, I compiled it statically (if I compiled normally, it would
be 11,811 bytes in size 8-) but still, nearly a megabyte there!
IMHO thats comparing apples with oranges. First, it looks like you forgot
to strip the binary. Second, statically compiled stuff is the exception,
not the norm on modern (and therefore OT) systems.
als@bruckner:/tmp/als/hello > l
total 4
-rw-r--r-- 1 als users 81 Aug 23 11:47 hello.c
als@bruckner:/tmp/als/hello > cat hello.c
#include <stdio.h>
int main(void) {
printf("Hello world!\n");
return 0;
}
als@bruckner:/tmp/als/hello > gcc -static -o hello hello.c
als@bruckner:/tmp/als/hello > l
total 1428
-rwxr-xr-x 1 als users 1451669 Aug 23 11:49 hello
-rw-r--r-- 1 als users 81 Aug 23 11:47 hello.c
als@bruckner:/tmp/als/hello > strip hello
als@bruckner:/tmp/als/hello > l
total 352
-rwxr-xr-x 1 als users 352140 Aug 23 11:49 hello
-rw-r--r-- 1 als users 81 Aug 23 11:47 hello.c
als@bruckner:/tmp/als/hello > gcc -o hello hello.c
als@bruckner:/tmp/als/hello > l
total 20
-rwxr-xr-x 1 als users 13336 Aug 23 11:51 hello
-rw-r--r-- 1 als users 81 Aug 23 11:47 hello.c
als@bruckner:/tmp/als/hello > strip hello
als@bruckner:/tmp/als/hello > l
total 8
-rwxr-xr-x 1 als users 3016 Aug 23 11:51 hello
-rw-r--r-- 1 als users 81 Aug 23 11:47 hello.c
The unstripped binary contains tons of symbol table information that is
only needed for debugging. And on modern UNIX system the only binaries
compiled statically (if any) are the binaries needed for emergency
rescue (when you can't rely on having /lib in usable state). Oh, and
maybe some commercial stuff linking against funny libraries (long time
standard for motif stuff to avoid runtime licenses).
Regards,
Alex.
--
We have gone from a world of concentrated knowledge and wisdom to one of
distributed ignorance. And we know and understand less while being
increasingly capable. -- Prof. Peter Cochrane, formerly of BT Labs