[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: egcs produces bloated code by default



On 26 Oct 1998, Ben Pfaff wrote:

> Jason Gunthorpe <jgg@gpu.srv.ualberta.ca> writes:
> 
>    No, exception handling is a C++ only feature it will have no effect on C
>    programs whatsoever [huge egcs bug otherwise]. We have already taken the
>    size penatly for exception handling when we switched to eg++. 
> 
> I was also about to say that this exception code bloat applies only to
> C++ but the results of some tests were surprising:

You didn't strip the binaries. You might find that egcs puts some debug
segments in.

Wakko{jgg}/tmp#cat t.cc
int main(){}
Wakko{jgg}/tmp#g++ -v
Reading specs from /usr/lib/gcc-lib/i486-linux/egcs-2.91.57/specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
Wakko{jgg}/tmp#g++ t.cc
Wakko{jgg}/tmp#ls -l a.out; size a.out
-rwxrwxr-x   1 jgg      jgg          4832 Oct 25 22:15 a.out*
   text    data     bss     dec     hex filename
   1253     268      28    1549     60d a.out
Wakko{jgg}/tmp#strip a.out
Wakko{jgg}/tmp#ls -l a.out; size a.out
-rwxrwxr-x   1 jgg      jgg          3160 Oct 25 22:15 a.out*
   text    data     bss     dec     hex filename
   1253     268      28    1549     60d a.out     

------

Wakko{jgg}/tmp#mv t.cc t.c
Wakko{jgg}/tmp#gcc t.c
Wakko{jgg}/tmp#gcc -v
Reading specs from /usr/lib/gcc-lib/i486-linux/2.7.2.3/specs
gcc version 2.7.2.3   
Wakko{jgg}/tmp#ls -l a.out; size a.out
-rwxrwxr-x   1 jgg      jgg          4019 Oct 25 22:16 a.out*
   text    data     bss     dec     hex filename
    991     184       4    1179     49b a.out 

----------

Wakko{jgg}/tmp#g++ t.c
Wakko{jgg}/tmp#ls -l a.out; size a.out
-rwxrwxr-x   1 jgg      jgg          4831 Oct 25 22:17 a.out*
   text    data     bss     dec     hex filename
   1253     268      28    1549     60d a.out     

I'm not sure what's up with your system but it certainly does not match my
results.. Try stripping the file.

Jason


Reply to: