This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Executable size increase using egcs 1.0.1 on Solaris 2.6


I wrote a simple hello.c

#include <stdio.h>

main()
{
    printf("Hello World!\n");
}

And compiled it with gcc-2.7.2 , egcs-1.0.1(haifa enabled) and
egcs-1.02-980309-prerelease(haifa disabled)

The following are the file sizes and the output of size -f

----------------------------------------------------------------------
gcc-2.7.2
Size:			5440 bytes
% size -f foo

17(.interp) + 300(.hash) + 672(.dynsym) + 188(.dynstr) +
32(.SUNW_version) + 12(.rela.bss) + 48(.rela.plt) + 352(.text) +
20(.init) + 20(.fini) + 22(.rodata) + 12(.got) + 152(.dynamic) +
100(.plt) + 0(.data) + 8(.ctors) + 8(.dtors) + 4(.bss) = 1967

----------------------------------------------------------------------
egcs-1.0.1
Size:			24952 bytes
% size -f foo


17(.interp) + 460(.hash) + 960(.dynsym) + 391(.dynstr) +
32(.SUNW_version) + 12(.rela.bss) + 144(.rela.plt) + 3344(.text) +
28(.init) + 20(.fini) + 35(.rodata) + 36(.got) + 152(.dynamic) +
196(.plt) + 8(.data) + 8(.ctors) + 8(.dtors) + 424(.eh_frame) +
32(.bss) = 6307

----------------------------------------------------------------------
egcs-1.0.2-980308-prerelease
Size:			25016 bytes
% size -f foo

17(.interp) + 460(.hash) + 960(.dynsym) + 391(.dynstr) +
32(.SUNW_version) + 12(.rela.bss) + 144(.rela.plt) + 3376(.text) +
28(.init) + 20(.fini) + 35(.rodata) + 36(.got) + 152(.dynamic) +
196(.plt) + 8(.data) + 8(.ctors) + 8(.dtors) + 424(.eh_frame) +
32(.bss) = 6339

Compile command was gcc -o foo foo.c

Is this expected behaviour. Why is there such an increase in
executable code size. I have not looked at other platforms yet

Cheers, Yusuf

-- 
Kent Ridge Digital Labs (Formerly Institute of Systems Science)
Heng Mui Keng Terrace, Singapore 119597, Republic of Singapore
Tel: +65 874-3116, Fax: +65 774-4990,  Email: yusufg@krdl.org.sg


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]