From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <5349b00f466d3b20ddfbe1a715770213@terzarima.net> To: 9fans@cse.psu.edu Subject: Re: [9fans] Install from CD fails From: Charles Forsyth Date: Tue, 18 Apr 2006 22:10:18 +0100 In-Reply-To: <990bf6d77ac4862d05e894abb314ebc7@hamnavoe.com> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Topicbox-Message-UUID: 3d41732a-ead1-11e9-9d60-3106f5b1d025 > The change I made in 5l was to discard all unreachable code, whether > it came from a library object file or from the main program. It was > mostly useful for tidying up programs which had been evolving for > a while, when the authors hadn't bothered to delete functions which > were no longer used. But that wouldn't help with what Russ described: it turned out to do more than that, for quite sensible programs. it's now quite common to have object files in libraries that provide a set of functions, only some of which are actually used by any particular program. indeed, given a linker that works that way, it becomes more attractive to move beyond `one function per file' and collect things in a more modular way. you've mentioned one case that it wouldn't eliminate (functions referenced through a static array). another interesting case turned up in Tk and a few other places where there were functions for use by debugging code that wasn't compiled in, and so with the reachable-code change, those functions were eliminated.