delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/12/06/03:14:27

From: gunther DOT ebert AT ixos-leipzig DOT de (Gunther Ebert)
Subject: Re: Size of smallest program
6 Dec 1996 03:14:27 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <32A6858A.E41.cygnus.gnu-win32@ixos-leipzig.de>
References: <m0vVMq2-000ALAC AT jacob DOT remcomp DOT fr>
Mime-Version: 1.0
X-Mailer: Mozilla 3.0Gold (WinNT; I)
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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
> "gnu-win32-request AT cygnus DOT com" with one line of text: "help".
-
For help on using this list, send a message to
"gnu-win32-request AT cygnus DOT com" with one line of text: "help".

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019