Message-ID: <37F957D1.43BA@ns.sympatico.ca> From: Klaas X-Mailer: Mozilla 3.04 (Win95; I) MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Re: Linker trimming unused code/data References: <37F91817 DOT 910DB5E4 AT hmc DOT edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 30 Date: Tue, 05 Oct 1999 01:44:16 GMT NNTP-Posting-Host: 142.177.95.67 X-Complaints-To: abuse AT ns DOT sympatico DOT ca X-Trace: sapphire.mtt.net 939087856 142.177.95.67 (Mon, 04 Oct 1999 22:44:16 ADT) NNTP-Posting-Date: Mon, 04 Oct 1999 22:44:16 ADT Organization: Sympatico-Subscriber To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com Nate Eldredge wrote: > > Eli Zaretskii wrote: > > > > On Mon, 4 Oct 1999, Gautier wrote: > > > > > > What you need to do is to divide a single module into several smaller > > > > modules. Then the linker will only link in those modules which you > > > > actually need in your program. > > > > > > Of course - but in fact (after some inquiry etc.) the `ld' linker is almost > > > the only that can't do it itself! > > > > If you think GNU ld should support this feature, I suggest posting to > > gnu.utils.bug (or write to its e-mail gateway, bug-gnu-utils AT gnu DOT org) > > where it will be seen by Binutils maintainer(s). > > Note that some people might expect this behavior. For instance, many > RCS-controlled projects insert a version string in each file like: > > static char rcsid[] = "$$RCS$43278$foo$bar$baz"; > > Since this is compiled in to the binary, one can tell what version of > each source file went into a given binary. If ld removed it, this would > break. Of course the unused code-trimming could be implemented via commandline switch(es). -Mike