This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Help with strip
- From: "Aaron W. LaFramboise" <aaron98wiridge9 at aaronwl dot com>
- To: gkajmowi at tbaytel dot net
- Cc: binutils at sources dot redhat dot com
- Date: Sat, 18 Dec 2004 19:25:17 -0600
- Subject: Re: Help with strip
- References: <200412181210.28709.gkajmowi@tbaytel.net>
Garrett Kajmowicz wrote:
> When the object file is linked into a larger file, I do not want that code to
> be included. More precisely, I want that symbol to be considered undefined.
> Weak symbols won't do.
In addition to Zack's comments, note that most ELF targets (such as
GNU/Linux) have a --gc-sections option that will remove sections that
can be determined to be unreferenced.
Note that, in general, as Zack says, you can't simply remove data of any
sort from the middle of a section, no matter what sort it is. You can
remove the symbol, but that will not remove the data that the symbol
refers to.
The way that most people do this sort of thing is by causing the
compiler to not emit the unwanted function at all.
Aaron W. LaFramboise