This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Fix linking of .gpdword on MIPS
On Wed, Feb 28, 2007 at 09:33:14AM +1030, Alan Modra wrote:
> 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.
There are no regressions with my patch. But I don't know if there
are testcases to check ld -r and ld -emit-relocs for this specific
case.
H.J.