From: Nate Eldredge Newsgroups: comp.os.msdos.djgpp Subject: Re: Linker trimming unused code/data Date: Mon, 04 Oct 1999 14:11:51 -0700 Organization: Harvey Mudd College Lines: 27 Message-ID: <37F91817.910DB5E4@hmc.edu> References: NNTP-Posting-Host: mercury.st.hmc.edu Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Trace: nntp1.interworld.net 939071550 7440 134.173.45.219 (4 Oct 1999 21:12:30 GMT) X-Complaints-To: usenet AT nntp1 DOT interworld DOT net NNTP-Posting-Date: 4 Oct 1999 21:12:30 GMT X-Mailer: Mozilla 4.61 [en] (X11; U; Linux 2.2.13pre12 i586) X-Accept-Language: en To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com 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. -- Nate Eldredge neldredge AT hmc DOT edu