www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1998/09/17/09:53:13

Date: Thu, 17 Sep 1998 16:52:50 +0300 (IDT)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Rylan <rylan AT inbtekom DOT co DOT za>
cc: djgpp AT delorie DOT com
Subject: Re: Excluding unused Allegro Functions
In-Reply-To: <6tnk2k$7vm$3@news2.saix.net>
Message-ID: <Pine.SUN.3.91.980917164830.13805I-100000@is>
MIME-Version: 1.0

On Wed, 16 Sep 1998, Rylan wrote:

> I recently noticed while using FSDB that, when debugging Allegro code (I
> just looked at one of my Allegro using programs) that there are functions
> and routines included in the final .EXE that I do not use AT ALL in the
> program - so I want to ask too if there is anyway to exclude these unused
> library functions, not just for Allegro but any library from the final
> resulting .EXE?

The linker cannot load part of an object module.  So, if a single .o file 
stored in a library defines several functions, it loads all of them, even 
if your program only needs one of them.  You cannot do anything to 
prevent that.

However, the DJGPP library usually makes a point of putting every 
function on its own module, unless they cannot be separated.  A notable 
exception is the conio functions (cprintf, cputs, gotoxy etc.): they are 
all defined on a single module.  But the conio functions are so 
intertwined and call one another so many times, that you cannot easily 
separate them anyway.

- Raw text -


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