This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] MIPS/GAS: Complete constant JMP relocs straight away
- From: "Maciej W. Rozycki" <macro at codesourcery dot com>
- To: David Daney <ddaney dot cavm at gmail dot com>
- Cc: <binutils at sourceware dot org>, Richard Sandiford <rdsandiford at googlemail dot com>
- Date: Fri, 21 Sep 2012 21:15:25 +0100
- Subject: Re: [PATCH] MIPS/GAS: Complete constant JMP relocs straight away
- References: <alpine.DEB.1.10.1209211810150.28358@tp.orcam.me.uk> <505CBD38.8020401@gmail.com>
David,
> > In the unlikely case a constant is used as the argument of a jump
> > instruction, e.g.
> >
> > j 0xbfc00000
> >
> > the associated JMP relocation is resolved straight away in append_insn and
> > the instruction's immediate field initialised while the instruction is
> > being assembled,
>
> I haven't fully studied the code, but this seems error prone.
>
> Why don't we just emit the relocation without resolving it in the assembler?
> Wouldn't it be nicer to get a warning/error message out of the linker where
> the address of the J is known and it is determined that we are attempting to
> span a forbidden boundry?
>
> It is possible I am missing the point here. If so, just ignore this.
That could be done. An artificial absolute symbol would have to be
created and assigned the constant referred. The relocation would then
refer to that symbol and remain for the linker to resolve and check the
range while doing that. But is it worth the effort? If so, then please
go ahead, sure!
Maciej