Path: utzoo!attcan!uunet!know!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!aplcen!haven!adm!smoke!gwyn From: gwyn@smoke.brl.mil (Doug Gwyn) Newsgroups: comp.lang.c Subject: Re: EXE file size Message-ID: <14433@smoke.brl.mil> Date: 12 Nov 90 13:29:02 GMT References: <16398@mentor.cc.purdue.edu> <4302@sactoh0.SAC.CA.US> Organization: U.S. Army Ballistic Research Laboratory, APG, MD. Lines: 14 In article <4302@sactoh0.SAC.CA.US> jak@sactoh0.SAC.CA.US (Jay A. Konigsberg) writes: >I have wondered the same thing. Mainly, why are C exectuables so large. >foo.c 11 >foo.o 256 >foo 4815 The executable contains a run-time startoff module (crt0.o), plus some library functions needed by crt0.o, such as exit(). Clever C library implementations are able to arrange that the stdio overhead normally needed to support exit() is not linked in when stdio functions are not invoked directly by the application; otherwise, there would also be all the static _iob structs and the code for fclose(), fflush(), etc. crt0.o also is responsible for collecting environment variables and program arguments so that they can be passed to main() etc.