g++-19980531: Big executables.
Dirk Herrmann
dirk@ida.ing.tu-bs.de
Wed Jul 15 11:36:00 GMT 1998
Hello everybody.
I think that egcs generates unnecessary big executables.
This is what I did:
> uname -a
SunOS demokrit 5.5.1 Generic sun4u sparc SUNW,Ultra-1
> cat test1.cc
int main()
{
}
> cat test2.cc
#include <string>
int main()
{
}
> g++ -Wall -g test1.cc -o test1.out
> g++ -Wall -g test2.cc -o test2.out
> ll test*out
-rwxr-xr-x 1 stab 37592 Jul 15 16:50 test1.out*
-rwxr-xr-x 1 stab 68236 Jul 15 16:51 test2.out*
> strip test*out
> ll test*out
-rwxr-xr-x 1 stab 9584 Jul 15 16:51 test1.out*
-rwxr-xr-x 1 stab 13936 Jul 15 16:51 test2.out*
Although the string class is not used at all, including it costs more than
30kByte additional memory when compiling with -g. And, after stripping, it's
still more than 4k.
There seems to be some unnecessary instantiation going on.
Best regards,
Dirk Herrmann
More information about the Gcc
mailing list