From: Hans-Bernhard Broeker Newsgroups: comp.os.msdos.djgpp Subject: Re: DJGPP EXE file size vs Linux Date: 1 Nov 2000 03:22:50 GMT Organization: Aachen University of Technology (RWTH) Lines: 23 Message-ID: <8to2aa$60v$1@nets3.rz.RWTH-Aachen.DE> References: <39FF85E3 DOT 35B34DAC AT usq DOT edu DOT au> NNTP-Posting-Host: acp3bf.physik.rwth-aachen.de X-Trace: nets3.rz.RWTH-Aachen.DE 973048970 6175 137.226.32.75 (1 Nov 2000 03:22:50 GMT) X-Complaints-To: abuse AT rwth-aachen DOT de NNTP-Posting-Date: 1 Nov 2000 03:22:50 GMT Originator: broeker@ To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Ron House wrote: > Hi all, I have an app that was originally C, but later I included > classes and made it C++. Since then the file size has blown out hugely, If an executable size blowup occured exactly at the point you switched from C to C++, then the most likely cause of it are large static arrays. C++ can require them to be present at their full size, right in the executable file. > puzzling, the stripped sizes of the exe under Linux and DJGPP are vastly > different: 950K vs 1.9Mb. That's most probably by unfair comparison. To make a reasonable test, here, you have to compare a Linux binary built with linking option '-static'. You'll find that this creates a program that'll be about as large as the DJGPP version, I think. To know for real where all that size is going, make an 'nm' or 'objdump' listing of the executable sorted by size of the individual object. Or at least have a solid look at 'size -A' outputs. -- Hans-Bernhard Broeker (broeker AT physik DOT rwth-aachen DOT de) Even if all the snow were burnt, ashes would remain.