This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
incredible increase in executable size (AIX)
- From: Joerg dot Richter at pdv-FS dot de
- To: gcc at gcc dot gnu dot org
- Date: Fri, 5 Dec 2003 10:39:38 +0100
- Subject: incredible increase in executable size (AIX)
Hi,
I just installed GCC 3.3.2 on Linux and AIX. But I must see that the
executable size on AIX is between 10 and 100 times bigger compared to GCC
3.2.1.
Take this simple program:
#### foo.cc ####
int main()
{
return 0;
}
#### runtest ####
#! /usr/bin/ksh
set -x
/tools/pkg/gcc/3.2.1/bin/g++ -v
/tools/pkg/gcc/3.3.2/bin/g++ -v
/tools/pkg/gcc/3.2.1/bin/g++ foo.cc -o foo.321
/tools/pkg/gcc/3.3.2/bin/g++ foo.cc -o foo.332
ls -l foo.321 foo.332
size -df foo.321 foo.332
#### end ####
The output of runtest on AIX is:
+ /tools/pkg/gcc/3.2.1/bin/g++ -v
Reading specs from
/tools/pkg/gcc/3.2.1/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.2.1/specs
Configured with: configure --prefix=/tools/pkg/gcc/3.2.1 --with-ld=/bin/ld
--with-as=/bin/as --enable-languages=c,c++
Thread model: aix
gcc version 3.2.1
+ /tools/pkg/gcc/3.3.2/bin/g++ -v
Reading specs from
/tools/pkg/gcc/3.3.2/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.2/specs
Configured with: ../gcc-3.3.2/configure --prefix=/tools/pkg/gcc/3.3.2
--with-ld=/bin/ld --with-as=/bin/as --enable-languages=c,c++,f77
Thread model: aix
gcc version 3.3.2
+ /tools/pkg/gcc/3.2.1/bin/g++ foo.cc -o foo.321
+ /tools/pkg/gcc/3.3.2/bin/g++ foo.cc -o foo.332
+ ls -l foo.321 foo.332
-rwxrwxr-x 1 jrichter jrichter 18557 Dec 05 10:06 foo.321
-rwxrwxr-x 1 jrichter jrichter 3471941 Dec 05 10:06 foo.332
+ size -df foo.321 foo.332
foo.321: 1236(.text) + 644(.data) + 32(.bss) + 6456(.loader) = 8368
foo.332: 243023(.text) + 58057(.data) + 40(.bss) + 100168(.loader) +
1170278(.debug) = 1571566
Ok. Somehow 332 generates debug information and 321 not. But look at the
difference in the .text and .data size.
While on Linux:
+ /tools/pkg/gcc/3.2.1/bin/g++ -v
Reading specs from
/tools/pkg/gcc/3.2.1/lib/gcc-lib/i686-pc-linux-gnu/3.2.1/specs
Configured with: configure --prefix=/tools/pkg/gcc/3.2.1
--enable-languages=c++,c,f77
Thread model: posix
gcc version 3.2.1
+ /tools/pkg/gcc/3.3.2/bin/g++ -v
Reading specs from
/tools/pkg/gcc/3.3.2/lib/gcc-lib/i686-pc-linux-gnu/3.3.2/specs
Konfiguriert mit: ../gcc-3.3.2/configure --prefix=/tools/pkg/gcc/3.3.2
--enable-languages=c,c++,f77
Thread model: posix
gcc-Version 3.3.2
+ /tools/pkg/gcc/3.2.1/bin/g++ foo.cc -o foo.321
+ /tools/pkg/gcc/3.3.2/bin/g++ foo.cc -o foo.332
+ ls -l foo.321 foo.332
-rwxrwxr-x 1 jrichter decide 13463 Dez 5 10:15 foo.321
-rwxrwxr-x 1 jrichter decide 13031 Dez 5 10:15 foo.332
+ size -df foo.321 foo.332
text data bss dec hex filename
1028 288 28 1344 540 foo.321
778 276 4 1058 422 foo.332
Looks like everything is fine here.
I think I made something fundamental wrong. But I can't see what. Perhaps
you have same hints.
Joerg