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: Fix linking of .gpdword on MIPS


On Tue, Feb 27, 2007 at 07:10:51AM -0500, Daniel Jacobowitz wrote:
> On Tue, Feb 27, 2007 at 09:32:23AM +0000, Richard Sandiford wrote:
> > I'll give it a go.  I'm not sure I can help with:
> > 
> >     http://sourceware.org/ml/binutils/2007-02/msg00110.html
> > 
> > though, which seems to have been the last word on the patch.
> 
> Alan, could you expand on what you meant?

The existing code removes the symbol from the reloc.  After relocating
the section (zeroing whatever the reloc points to), the reloc will be
emitted for ld -r and ld -emit-relocs.  So you get a reloc against
STN_UNDEF.

The new code does not remove the symbol from the reloc, so we'll emit
a reloc against a symbol in a discarded section.  I'm not sure whether
the emit_relocs code handles that properly, which is what I was asking
HJ to check.  Also, emitting the reloc against the symbol is wrong
because it is inconsistent with what happened in relocate_section.
We didn't actually apply the reloc.

Thinking about it some more, I reckon the existing code is wrong
anyway.  I guess what should really happen is that we emit an R_NONE
reloc.  That would be consistent with not applying the reloc in
relocate_section, and would prevent further modification of the zeroed
location.

-- 
Alan Modra
IBM OzLabs - Linux Technology Centre


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