This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: MIPS %half in gas
- From: "Maciej W. Rozycki" <macro at linux-mips dot org>
- To: Richard Sandiford <rsandifo at nildram dot co dot uk>
- Cc: binutils at sourceware dot org
- Date: Mon, 15 Oct 2007 13:39:48 +0100 (BST)
- Subject: Re: MIPS %half in gas
- References: <1096932306.3676.43.camel@localhost.localdomain> <20041005014927.GA26907@nevyn.them.org> <20071012154340.GC9046@caradoc.them.org> <87k5pscjhn.fsf@firetop.home>
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