delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1999/05/13/14:00:31

Sender: nate AT cartsys DOT com
Message-ID: <373B13B9.44DB1927@cartsys.com>
Date: Thu, 13 May 1999 11:02:33 -0700
From: Nate Eldredge <nate AT cartsys DOT com>
X-Mailer: Mozilla 4.08 [en] (X11; I; Linux 2.2.5 i586)
MIME-Version: 1.0
To: djgpp AT delorie DOT com
Subject: Re: exe size (Allegro)
References: <612N3UJ05AqW092yn AT jagor DOT srce DOT hr> <373609F7 DOT A879AC8 AT go DOT ro>
Reply-To: djgpp AT delorie DOT com

Radu Georgescu aka skoola wrote:
> 
> > I just started using Allegro library and I am fascinated with the size of my
> > executables. I have read the djgpp faq (that means that I am using -O2 and -s
> > compiler options) and yet I am getting >300k exe (using few allegro functions).
> > I have also read the allegro.txt file (where it mentions reducing the size of
> > exe), I followed the instructions but I get parse errors.

Tell us what you're doing (verbatim) and what the errors say.

> > How can I completely remove all joystick, soundcard, etc. drivers?
> > Can it be done without relinking the library (I hope so)?
> > Please help!
> 
> and another thing: isn't there an option not to link the functions that are not
> called?

They aren't, practically speaking.

The linker links only the *object files* which are referenced.  Since a
library (like libc.a) is really just a conglomeration of object files,
and generally speaking has only one function defined per object file,
you get essentially only those functions which are called.

The difficulty occurs in that the startup code calls quite a few of
them.  This is unavoidable due to the complexities of DPMI and the
Unix-style command-line parsing etc.

The FAQ tells you how you can arrange for some of the largest pieces of
this (like command-line globbing) to be omitted, if you don't need
them.  This can save several K.

Allegro is probably where most of the size is coming from.  The Allegro
docs say why this is and what you can do about it.  If it doesn't work
for you, that's another issue which should be resolved.
-- 

Nate Eldredge
nate AT cartsys DOT com

- Raw text -


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