executable size

Dave Ciemiewicz ciemo at bananapc.wpd.sgi.com
Sun Feb 25 08:17:46 AEST 1990


In article <17280032 at acf4.NYU.EDU>, mcqueen at acf4.NYU.EDU (David M.
McQueen) writes:
> /* acf4:comp.sys.sgi / trohling at uceng.UC.EDU (tom rohling) / 12:27 am 
Feb 24, 1990 */
> 
> >     On a related note to my other article, can the size of an executable
> >be reduced while still being an executable?  I noticed that the size of the
> >exec for some of the demos and such are very small but any extensive 
> >graphics thing I do is easily over 800k in size so something must have been
> >done to 'em right? 
> >
> > Any ideas?
> >
> >===========================================================================
> >Tom Rohling                       "Infinity is where things happen 
> >trohling at uceng.uc.edu                 that don't."  -Anonymous
> >      or
> >rohling at afiris.ase.uc.edu
> >===========================================================================
> /* ---------- */
> 
> Two ways I have found to reduce the size of executables are:
> 
>   1) compile using shared graphics libraries. As an example (Fortran, but
>      similar and even greater reductions are possible with C programs):
> 
>      With f77  program.f -lfgl -lgl   : 652704 bytes
>      With f77  program.f -lfgl -lgl_s : 453440 bytes
> 
>      a reduction of about 200 Kbytes
> 
>   2) again in Fortran, if you are using large arrays, place those arrays
>      in labelled common blocks.
> 
> 
>
===============================================================================
> Disclaimer:  The above is just my opinion. God Alone Knows.
> 
> David M. McQueen,Courant Institute of Mathematical Sciences,New York
University
> 
> "The difference between long-distance commuting and long-distance
computing is
>  that with long-distance computing you can stay in your office and get
stuck in
>  traffic."

The MIPS compilers used on SGI, MIPS, and other competitor's workstations
generate a lot of symbol information in executables, even if no debugging
is selected.  This symbol info includes function names, globals, and
line number information.  This level of detail allows you to dbx an
executable (too a limited extent) or use pixie for profiling.  If you
are satisfied that you do not want or need any of this symbol info
in you code (i.e. if you are shipping it to customers), you can strip
your executable using the program strip(1).  This should reduce the
size of your executables by possible a couple hundred 'k'.  Don't go
stripping your libraries though -- you won't be able to link to them.

					--- Ciemo



More information about the Comp.sys.sgi mailing list