Mail Archives: djgpp/2000/07/16/10:47:18
My program is myprog.cpp so I guess (was a bug).
I have to say I never heard of BSS, I only knew about the DATA segment.
So if I have : unsigned long long BITMAPa [ 64 ];
and another BITMAPb (initialized) my program prints this
(in French) :
Adresse de _BITMAPa = 60968 /* (uninitialized in Data segment ?) */
sizeof de _BITMAPa = 512
Adresse de _BITMAPb = 57056 /* (initialized in BSS segment ?) */
sizeof de _BITMAPb = 512
A program snippet with 2 arrays produces a 143k binary which gets strip'ped
down to 60k. Can UPX do better ?
Damian Yerrick a écrit dans le message ...
>On Sat, 15 Jul 2000 18:06:38 -0500, "Michel Chassey"
><michelc AT primus DOT ca> wrote:
>
>>I use many global arrays in my program and I am puzzled because the
>>binary size increase does not reflect sizeof ( _new_array).
>>As an example, adding : unsigned long long _BITMAP [ 64 ];
>>(sizeof is 512), produces a binary size increase of only about 53
>>bytes. This last number varies from 49 to 53.
>>
>>Could you point me to some reference on how globals are stored
>
>Ever heard of BSS? Many systems' binaries have three segments, called
>TEXT (program code), DATA (pre-initialized global and static data),
>and BSS (uninitialized global and static data that will be allocated
>and zero-filled on run). DJGPP probably has something similar.
>
>There is (was?) a bug in GCC that put C++ programs' uninitialized
>global data in DATA instead of BSS; however, it's zeroes, and zeroes
>are easily compressible (see also UPX).
> http://upx.tsx.org/
>
>--
>Damian Yerrick
>"I refuse to listen to those who refuse to listen to reason."
>See the whole sig: http://www.rose-hulman.edu/~yerricde/sig.html
>
>This is McAfee VirusScan. Add these two lines to your signature to
>prevent the spread of signature viruses. http://www.mcafee.com/
- Raw text -