size of executables

pefv700 at perv.pe.utexas.edu pefv700 at perv.pe.utexas.edu
Sat Dec 1 05:40:57 AEST 1990


I am trying to write my own version of cat(1) in C.  When I use default
options for cc(1) (and those of ld(1)), for smallish programs, the
executable size is always 24576 bytes.  The only way I have found to
reduce that is strip(1), which reduces the size to 16384 bytes.  By 
comparison, /bin/cat is only 6312 bytes.

I am using SunOS 4.? and have RTM but the options that deal with size
(-S for cc and -x and -X for ld -- of course -s for cc is the same as strip)
don't change anything.  

Even a program which does nothing is 24576 bytes:

skelly% cat nothing.c
main() { }
skelly% cc nothing.c
skelly% ls -l a.out
-rwx------  1 pefv700     24576 Nov 30 11:29 a.out

What am I missing?

+-------------------------------+--------------------------------------------+
| Christopher Phillips          |        #include "stupid_UNIX_quotes.h"     |
| pefv700 at skelly.pe.utexas.edu  |           When in doubt, push pawn.        |
+-------------------------------+--------------------------------------------+



More information about the Comp.unix.questions mailing list