home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / lang / fortran / 3417 < prev    next >
Encoding:
Internet Message Format  |  1992-09-03  |  1.9 KB

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