Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 14 Sep 1998 16:15:30 +0200
From:      Eivind Eklund <eivind@yes.no>
To:        Mike Smith <mike@smith.net.au>
Cc:        freebsd-chat@FreeBSD.ORG
Subject:   Re: Unused functions
Message-ID:  <19980914161530.26760@follo.net>
In-Reply-To: <199809140114.SAA08497@word.smith.net.au>; from Mike Smith on Sun, Sep 13, 1998 at 06:14:32PM -0700
References:  <199809140009.TAA28013@isua4.iastate.edu> <199809140114.SAA08497@word.smith.net.au>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Sep 13, 1998 at 06:14:32PM -0700, Mike Smith wrote:
> >   Just so I completely understand, if I truely use only one function in from
> > a .o file and no other function is using anything in this .o file, the 
> > entire .o file is still pulled into the executable?  So, there are could be 
> > a lot of unused, unreachable code in an executable.  Nothing can be done to
> > remove the bloat after the executable has been linked?  Is this commonly the 
> > way its done on other systems as well?  I had always assumed that unused
> > functions and data were tosed out.
> 
> In most object formats, reference information is kept on a per-object 
> basis (ie. per .o file).  Keeping this sort of information on any 
> smaller granularity would lead to an insane increase in the complexity 
> and corresponding performance reduction of the link phase.

"Insane" is somewhat an overstatement here.  E.g. Eiffel and Sather
does things this way, doing a full call-tree analysis to throw away
unused code (globally).  This does not spend large amounts of time.
If I have to choose between the compiler/linker spending a little more
time and generating incorrect or sub-optimal code, I will almost
always want the linker & compiler to spend more time.

Eivind, who want link-time optimization - to get truly global
optimizations.

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-chat" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980914161530.26760>