Subject: Re: Size of smallest program
From: [email-masked] (Gunther Ebert)

6 Dec 1996 03:14:27 -0800
Sender: [email-masked]
Approved: [email-masked]
Distribution: cygnus
Message-ID: <[email-masked]>
References: <[email-masked]>
Mime-Version: 1.0
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
X-Mailer: Mozilla 3.0Gold (WinNT; I)
Original-To: [email-masked]
Original-Sender: [email-masked]

Hi,

I have compiled your hello world program using Cygnus gnu-win32 b16 and
Colin Peters' mingw32 package (it is an interface for using crtdll.dll 
instead of cygwin.dll) and I got an executable with a size of 3072 bytes
(stripped).
The section sizes are
..text   1024
..bss      24 (!)
..data    512
..idata   512

The size of headers is 1024.

(I don't understand that, adding all sizes I get 3096, but the
executable file
size is 3072, hello Cygnus, is there something wrong?)

root wrote:
> 
> I have (at last) produced a fairly stable version of lcc for win-32. I have
> been optimizing linker/compiler and other tools for size, and I think I have
> reached the bottom:
> #include <stdio.h>
> main(){printf("Hello world\n");}
> produces an executable of only 3616 bytes!!
> .text: 1024 (code)
> .rdata: 512
> .data:  512
> .idata: 512 (import tables for the crtdll.dll library)
>        ----
>        2560
> headers: (section table, file header, Data directory)
>        1024
>        ----
>        3584 bytes. It seems I loose 32 bytes in an alignment somewhere...
> Could some kind soul compile (and strip) the same 'program' for gcc to have
> some figures to compare with? It would be nice to have the details if possible.
> 
> Thanks in advance for your cooperation.
> 
> P.S. To give you an idea, here are the figures for MS Developer's Studio
> (MSVC 4.0)
> HELLO.EXE: 17408 bytes
> .text: 10042
> .rdata:  512
> .data:  3584
> .idata: 1024
> .reloc: 1024
>         16186
> Headers: 1024
>         17210 (MSVC rounds up somewhere 198 bytes)
> --
> Jacob Navia     Logiciels/Informatique
> 41 rue Maurice Ravel                    Tel 01 48.23.51.44
> 93430 Villetaneuse                      Fax 01 48.23.95.39
> France
> -
> For help on using this list, send a message to
> "[email-masked]" with one line of text: "help".
-
For help on using this list, send a message to
"[email-masked]" with one line of text: "help".