This is the mail archive of the binutils@sourceware.org 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: removing symbol from partially linked object file


Andreas Schwab wrote:


When nothing references the symbol then there is of course no relocation.



OK, in the case where H.J Lu successfully removed the symbol, there was only a definition for symbol X in the object file. No reference => no relocation, which explains why the symbol could be removed successfully.

In my case, the symbol X is referenced in the object file b.o. The
symbol X is defined in the object file a.o.

The reason that I did the partial link was exactly to prevent
relocation. Please check my logic here:

If I perform a partial link of a.o and b.o, I create a single object
file ab.o where all references to symbol X are resolved. Because all
references are resolved, there is no need for further relocation.
Therefore, there should be no obstacles for removal of the symbol.

Where is the flaw in this logic?


Thanks,


Erik


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