public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* incredible increase in executable size (AIX)
@ 2003-12-05  9:55 Joerg.Richter
  2003-12-05 17:31 ` David Edelsohn
  0 siblings, 1 reply; 2+ messages in thread
From: Joerg.Richter @ 2003-12-05  9:55 UTC (permalink / raw)
  To: gcc

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: incredible increase in executable size (AIX)
  2003-12-05  9:55 incredible increase in executable size (AIX) Joerg.Richter
@ 2003-12-05 17:31 ` David Edelsohn
  0 siblings, 0 replies; 2+ messages in thread
From: David Edelsohn @ 2003-12-05 17:31 UTC (permalink / raw)
  To: Joerg.Richter; +Cc: gcc

>>>>> Joerg Richter writes:

Joerg> I just installed GCC 3.3.2 on Linux and AIX. But I must see that the
Joerg> executable size on AIX is between 10 and 100 times bigger compared to GCC
Joerg> 3.2.1.

Joerg> /tools/pkg/gcc/3.2.1/bin/g++ foo.cc -o foo.321
Joerg> /tools/pkg/gcc/3.3.2/bin/g++ foo.cc -o foo.332

Joerg> ls -l foo.321 foo.332
Joerg> size -df foo.321 foo.332

Joerg> #### end ####

Joerg> The output of runtest on AIX is:

Joerg> + /tools/pkg/gcc/3.2.1/bin/g++ -v
Joerg> Reading specs from
Joerg> /tools/pkg/gcc/3.2.1/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.2.1/specs
Joerg> Configured with: configure --prefix=/tools/pkg/gcc/3.2.1 --with-ld=/bin/ld
Joerg> --with-as=/bin/as --enable-languages=c,c++
Joerg> Thread model: aix
Joerg> gcc version 3.2.1
Joerg> + /tools/pkg/gcc/3.3.2/bin/g++ -v
Joerg> Reading specs from
Joerg> /tools/pkg/gcc/3.3.2/lib/gcc-lib/powerpc-ibm-aix5.1.0.0/3.3.2/specs
Joerg> Configured with: ../gcc-3.3.2/configure --prefix=/tools/pkg/gcc/3.3.2
Joerg> --with-ld=/bin/ld --with-as=/bin/as --enable-languages=c,c++,f77
Joerg> Thread model: aix
Joerg> gcc version 3.3.2
Joerg> + /tools/pkg/gcc/3.2.1/bin/g++ foo.cc -o foo.321
Joerg> + /tools/pkg/gcc/3.3.2/bin/g++ foo.cc -o foo.332
Joerg> + ls -l foo.321 foo.332
Joerg> -rwxrwxr-x   1 jrichter jrichter      18557 Dec 05 10:06 foo.321
Joerg> -rwxrwxr-x   1 jrichter jrichter    3471941 Dec 05 10:06 foo.332
Joerg> + size -df foo.321 foo.332
Joerg> foo.321: 1236(.text) + 644(.data) + 32(.bss) + 6456(.loader) = 8368
Joerg> foo.332: 243023(.text) + 58057(.data) + 40(.bss) + 100168(.loader) +
Joerg> 1170278(.debug) = 1571566

Joerg> Ok. Somehow 332 generates debug information and 321 not. But look at the
Joerg> difference in the .text and .data size.

	I have tried your testcase and cannot replicate this problem. 

	I do not think you should just dismiss the debugging information.
You did not compile or link with debugging enabled. I think if you find
where debugging is being enabled behind your back that you will find 
what other option is being enabled that increases the executable size.

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2003-12-05 17:27 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-12-05  9:55 incredible increase in executable size (AIX) Joerg.Richter
2003-12-05 17:31 ` David Edelsohn

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).