> 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.
