Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!usc!apple!vsi1!indetech!pacbell!sactoh0!jak From: jak@sactoh0.SAC.CA.US (Jay A. Konigsberg) Newsgroups: comp.lang.c Subject: Re: EXE file size, C vs. Pascal Keywords: C, Pascal, MsDos Message-ID: <4302@sactoh0.SAC.CA.US> Date: 11 Nov 90 19:06:21 GMT References: <16398@mentor.cc.purdue.edu> Organization: Sacramento Public Access Unix, Sacramento, Ca. Lines: 81 In article <16398@mentor.cc.purdue.edu> nuspljj@mentor.cc.purdue.edu (Joseph J. Nuspl Jr.) writes: > >Over the past year, I have written several Unix-like commands -- cat, ls, ... >in Turbo Pascal 5.5. I have recently rewritten them in Turbo C++ hoping >to improve speed and/or reduce file size. The C compiled programs are >significanly larger. Cat in Pascal is ~3k, Turbo C ~17, DeSmet C ~10. > I have wondered the same thing. Mainly, why are C exectuables so large. Given the minimum program (foo.c): main() { } The sizes are (on a 3B2/400 cc, but other machines/C compliers give about the same). bytes ----- foo.c 11 foo.o 256 foo 4815 As a program gets larger, the overhead stays about the same. This implies that Unix/C creates a 4K+ header block. My only guess is that its for bss and stuff. Would anyone care to explain this and give references? I have looked at a.out.h(4) and suspect the answer is there, but am unable to ferret it out. -- ------------------------------------------------------------- Jay @ SAC-UNIX, Sacramento, Ca. UUCP=...pacbell!sactoh0!jak If something is worth doing, it's worth doing correctly. Newsgroups: poster Subject: Exectuable size of C (was: EXE file size, C vs. Pascal) Summary: Expires: References: <16398@mentor.cc.purdue.edu> Sender: Followup-To: Distribution: Organization: Sacramento Public Access Unix, Sacramento, Ca. Keywords: C, Pascal, MsDos In article <16398@mentor.cc.purdue.edu> nuspljj@mentor.cc.purdue.edu (Joseph J. Nuspl Jr.) writes: > >Over the past year, I have written several Unix-like commands -- cat, ls, ... >in Turbo Pascal 5.5. I have recently rewritten them in Turbo C++ hoping >to improve speed and/or reduce file size. The C compiled programs are >significanly larger. Cat in Pascal is ~3k, Turbo C ~17, DeSmet C ~10. > I have wondered the same thing. Mainly, why are C exectuables so large. Given the minimum program (foo.c): main() { } The sizes are (on a 3B2/400 cc, but other machines/C compliers give about the same). bytes ----- foo.c 11 foo.o 256 foo 4815 As a program gets larger, the overhead stays about the same. This implies that Unix/C creates a 4K+ header block. My only guess is that its for bss and stuff. Would anyone care to explain this and give references? I have looked at a.out.h(4) and suspect the answer is there, but am unable to ferret it out. -- ------------------------------------------------------------- Jay @ SAC-UNIX, Sacramento, Ca. UUCP=...pacbell!sactoh0!jak If something is worth doing, it's worth doing correctly.