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: [PATCH] MIPS/GAS: Complete constant JMP relocs straight away


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


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