delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1997/10/08/23:46:42

Newsgroups: comp.os.msdos.djgpp
From: Peter Berdeklis <peter AT atmosp DOT physics DOT utoronto DOT ca>
Subject: Re: OBJECTS, LIBRARIES, CODE SIZE, ETC.
Message-ID: <Pine.SGI.3.91.971008133720.19009A-100000@atmosp.physics.utoronto.ca>
Nntp-Posting-Host: chinook.physics.utoronto.ca
Sender: news AT info DOT physics DOT utoronto DOT ca (System Administrator)
Mime-Version: 1.0
Organization: University of Toronto - Dept. of Physics
In-Reply-To: <3.0.1.32.19971007045314.0068c780@chasque.apc.org>
Date: Wed, 8 Oct 1997 17:42:36 GMT
References: <3 DOT 0 DOT 1 DOT 32 DOT 19971007045314 DOT 0068c780 AT chasque DOT apc DOT org>
Lines: 24
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp

On Tue, 7 Oct 1997 baldo AT chasque DOT apc DOT org wrote:
> 	Hello. Now I have a curious question: why a lot of compilers canīt remove
> individual functions from an object file? It would be nice to add a switch
> to DJGPP to remove unused individual object functions in the linker. Maybe
> this is not possible. If not why not? Goodbye!

That would require a lot of information for the linker.  What file scope 
variables does the function use?  What is the start and end address of 
the function?  What other functions in the file does the function 
require?  This information is not currently kept in object files, and 
recording all the possible inter-dependencies could make the object files 
and the resulting libraries very large.

The compiler/linker can't do all the work for you.  At some point you've 
got to learn to code efficiently (time AND space) for yourself.

---------------
Peter Berdeklis
Dept. of Physics, Univ. of Toronto

- Raw text -


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