delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/1996/12/04/13:03:29

From: root AT jacob DOT remcomp DOT fr (root)
Subject: Size of smallest program
4 Dec 1996 13:03:29 -0800 :
Sender: daemon AT cygnus DOT com
Approved: cygnus DOT gnu-win32 AT cygnus DOT com
Distribution: cygnus
Message-ID: <m0vVMq2-000ALAC.cygnus.gnu-win32@jacob.remcomp.fr>
Original-To: gnu-win32 AT cygnus DOT com
Original-Sender: owner-gnu-win32 AT cygnus DOT com

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".

- Raw text -


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