This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Size of binaries with egcs
- To: egcs-bugs at cygnus dot com
- Subject: Size of binaries with egcs
- From: Jason Gunthorpe <jgg at gpu dot srv dot ualberta dot ca>
- Date: Sun, 7 Dec 1997 01:58:13 -0700 (MST)
Hi,
I have recompiled my project with egcs and have noticed a disturbing
trend. All the resulting stripped binaries are -double- their size from
gcc 2.7.2! A program which was ~50k is now 120k, a library that was ~98K
is almost 200K and another library that was in the 300k range is over
500k! The 'core' file size has also increased by about 400k (~800k to
1.3M)
Why the huge expansion of executable sizes? I'm simply compiling with -g
and -Wall as before.
I ran the executable through nm --demangle --size-sort and some of the
highest items are
<...>
000000ef r __WORD_BIT
000000fc ? __EXCEPTION_TABLE__
00000138 ? __EXCEPTION_TABLE__
000001e0 ? __FRAME_BEGIN__
00000348 ? __EXCEPTION_TABLE__
000004f0 ? __FRAME_BEGIN__
000007c0 ? __FRAME_BEGIN__
0000092c ? __FRAME_BEGIN__
00000b10 ? __FRAME_BEGIN__
0000179c ? __FRAME_BEGIN__
00001f90 ? __FRAME_BEGIN__
000021fc ? __FRAME_BEGIN__
00002d0c ? __FRAME_BEGIN__
The last 3 are bigger than any single member in the program. I figure the
total size of the listed items is 44970 bytes (!) What are these things
and are they necessary + could them be reduced? The nm output also shows a
fair number of items starting with a . like .LM444 and .Lscope67 etc.
There are alot of these (>100?), ranging from 113 bytes to 1 byte in size.
The story is the same for the libraries, several __FRAME_BEGIN__'s account
for a large number of bytes.
So, I suppose I should ask,
- What is __FRAME_BEGIN__
- Why is it so very large
- Can I get rid of it?
I have a feeling that these relate to exception handling, but I must say,
if exception handling results in double the executable I'd rather not have
it :<
Hm, here is some more to think about, nm --numeric-sort shows that alot of
these .L?? items are emitted directly after (before?) some member
function, suggesting they are related. The scary part is that they only
seem to be placed close to inlined functions. Why is this?
I'm really curious why all this is now necessary and wish to make you
aware that it does exist and how large it is.
Thanks for your patience,
Jason