www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/28/13:13:13

Date: Wed, 28 Jun 1995 15:48:18 +0100
From: Thomas Eifert <EIFERT AT reze-1 DOT rz DOT rwth-aachen DOT de>
Subject: Re: Size of a.out
To: "A.Appleyard" <A DOT APPLEYARD AT fs2 DOT mt DOT umist DOT ac DOT uk>, DJGPP AT sun DOT soe DOT clarkson DOT edu
Reply-To: eifert AT rz DOT rwth-aachen DOT de
Organization: Rechenzentrum RWTH Aachen

> C++ program             A.OUT size unstripped    A.OUT size stripped
> int x[10000]; main(){}  52269                    44140
> main(){}                15387                     7276
>    (difference)         36882                    36864
> 
>   Why does declaring the array `x' add so much size to A.OUT? Surely there is
> a more compact way of telling the loader to set the next 40000 bytes of RAM to
> all zeros, than to write out 40000 zeros at length in the .EXE file? Long ago
> in the CDC7600 mainframe's equivalent of .EXE files, there was a special
> compact notation for "repeat the next n bytes p times". Why not in PC's? (I
> know that the A.OUT from `int x[10000]; main(){}' contains 40000 consecutive
> ascii-zeros that aren't in the A.OUT from `main(){}': I just looked!)
> 

but if there are 1000 additional ints, why should be the exe 36882
bytes longer (and not 40000) ???

Thomas

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019