delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/07/08/01:24:53

From: j DOT aldrich6 AT genie DOT com
Message-Id: <199607080518.AA014673133@relay1.geis.com>
Date: Mon, 8 Jul 96 05:09:00 UTC 0000
To: djgpp AT delorie DOT com
Mime-Version: 1.0
Subject: Re: Executable size

Reply to message 9155790    from NAMILLE2 AT VT DOT E on 07/07/96  6:18PM


>What can be done about the large size of the executables
>produced by gcc?  A "hello world" program is bloated at
>57kb. I used the -O switchs, but that produced no change.
>What can be done about this?

As has been said many, many, many times before, a hello world is
not a realistic test case to determine the size of a compiler's output.
DJGPP programs have about 40-50K or so of overhead which includes
invoking DPMI, parsing the command line, loading environment
variables, and passing the argc and argv parameters to main().
The actual size of _your_ code is substantially smaller than most
other 32-bit compilers, especially with optimizations.  If you want
to cut out some of this overhead, you can define empty versions of
the functions __crt0_glob_function(), __crt0_load_environment_file(), and
__crt0_setup_arguments().  Of course, this removes the corresponding
functionality from your program.  Look up those functions in the libc
docs for more info.

John

- Raw text -


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