This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Help with strip


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]