Help with strip

Aaron W. LaFramboise aaron98wiridge9@aaronwl.com
Sun Dec 19 01:25:00 GMT 2004


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



More information about the Binutils mailing list