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: MIPS %half in gas


On Fri, 12 Oct 2007, Richard Sandiford wrote:

> > +      if (fixP->fx_done)
> > +	{
> > +	  if (*valP & ~0xffffull)
> > +	    {
> > +	      char value [32];
> > +
> > +	      sprintf_vma (value, *valP);
> > +	      as_bad_where (fixP->fx_file, fixP->fx_line,
> > +			    _("Number (0x%s) larger than 16 bits"), value);
> > +	    }
> > +
> > +	  if (target_big_endian)
> > +	    buf += 2;
> > +	  md_number_to_chars ((char *) buf, *valP, 2);
> > +	}
> > +      break;
> > +
> 
> Regarding the discussion downthread, the ABI specifically says that an
> R_MIPS_16 addend is signed rather than an unsigned, so (a) it really should
> be OK to use %half for ADDIU and LW, and (b), the *valP check above probably
> needs to check a signed range rather than an unsigned one, or at least
> allow both.

 Fair enough.  I only complained about the way of use in the test case, 
because the code above clearly treats the addend as unsigned.  I have had 
a look at the ABI document now and it documents a half16 relocatable field 
together with its associated R_MIPS_16 relocation like you say.  Although 
no indication there as to what it would be useful for.

  Maciej


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