From: "Thomas Harte" Newsgroups: comp.os.msdos.djgpp Subject: Re: Why does gcc make such big binaries? Date: 18 May 1997 23:15:21 GMT Organization: SoftySoft Lines: 33 Message-ID: <01bc63e0$f6f1d800$533363c3@default> References: <5ln5lu$i5l$1 AT news3 DOT microserve DOT net> NNTP-Posting-Host: host5-99-51-83.btinternet.com To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Precedence: bulk > it including debug info or something, but I know you can add -s as a > command line parameter when compiling to not add this stuff, or you > can type > strip program.exe > to do the same thing (I think it's the same) The thing you have to remember is that DOS is a 16bit OS & Borland is a 16bit compiler, so the two work in harmony, to produce small, tight (but slow) code. Together they chug along, perfectly happily, not going anywhere fast. DJGPP however produces 32bit code, which is intended to be run from DOS, a 16bit OS. Therefore, a program from DJGPP must, if you'll excuse the very simplistic description, push DOS out of the way, and get on with everything itself. Therefore, the extra size is also DJGPP setting up protected mode (part of it's 32bit-ness), and sorting out the DPMI memory it uses. This code is a fixed size however, so a formula for working out program size would be something like :- num_of_instructions*instruction_size+header_code, . . .whereas Borland, and other 16bit compilers would just be num_of_instructions*instruction_size. . . .which is really the simplest way I can think of to express what I think is correct, although it is largely what I have inferred, so I stand to be potentially proven very wrong. What I am sure if is that the extra size is necessary for speed. -Thomas http://www.softysoft.home.ml.org