removing symbol from partially linked object file

Erik Leunissen e.leunissen@hccnet.nl
Wed Nov 15 21:35:00 GMT 2006


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



More information about the Binutils mailing list