home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!copper!aspen.craycos.com!jrbd
- From: jrbd@craycos.com (James Davies)
- Newsgroups: comp.lang.fortran
- Subject: Re: Size of executables
- Message-ID: <1992Sep3.233139.4657@craycos.com>
- Date: 3 Sep 92 23:31:39 GMT
- References: <9209031948.AA10327@ros6.gsfc.nasa.gov>
- Organization: Cray Computer Corporation
- Lines: 31
-
- In article <9209031948.AA10327@ros6.gsfc.nasa.gov> mukai@ROS6.GSFC.NASA.GOV (Koji Mukai) writes:
- >
- >One recent post compared the size of executables between Fortran and C,
- >in passing. That has reminded me of something I've noticed a long time
- >ago: the size of the executable files are very different between VAX/VMS
- >(PROG.EXE) and UNIX (a.out) versions.
- {...}
- >I don't have detailed numbers but the Sun Fortran versions tend to
- >be 4-10 times bigger than the VAX/VMS version, whenever I checked.
- >
- >(1) Why? (Just curious)
-
- Shared libraries make a big difference. Both Sun and VMS have shared
- libraries enabled by default, but apparently VMS does a more thorough
- job of shoving stuff into the shared part.
-
- >(2) Can I make the Sun executables any smaller (the above numbers are
- >after strip)? Am I missing some compiler switches or something?
-
- You could make them *bigger* by specifying -Bstatic. This would be
- a way of finding out how much space the shared libraries are saving you.
- For example, linking with -Bstatic (on a sparc) increases the stripped
- executable size of a C hello-world program from 16K to 98K. However, the
- printf library support alone accounts for about 75K of that 98K.
-
- >(3) Are there any penalties for big executables, apart from the obvious
- >need for more disk space? Or for that matter, any advantages?
-
- Using shared libraries might allow different processes to share read-only
- code pages, so system memory might get better used, and load time might
- be less since they wouldn't have to get paged in initially by your program.
-