TLS support for MIPS

Thiemo Seufer ica2_ts@csv.ica.uni-stuttgart.de
Wed Feb 9 07:07:00 GMT 2005


Daniel Jacobowitz wrote:
> On Tue, Feb 08, 2005 at 09:30:15AM +0000, Richard Sandiford wrote:
[snip]
> > I don't like the way you've overloaded the %hi(%other(...)) syntax
> > to apply to single relocations.  I think it should be reserved for
> > true composite relocations (i.e. where the output file has both
> > R_MIPS_HI16 and R_MIPS_OTHER entries).
> > 
> > We already have separate operators for things like R_MIPS_CALL_HI16 and
> > R_MIPS_CALL_LO16, namely %call_hi() and %call_lo()[*].  I think it'd be
> > simpler and more consistent to have %dtpoff_hi() and %dtpoff_lo()
> > instead.  You'd then be able to get rid of hackery like:
> 
> I cribbed this approach from PowerPC (@tprel@ha) because it seemed
> eminently sensible.  If you'd prefer to use single operators instead,
> then I guess I can crib from a different architecture instead.

I agree with Richard, explicit %*_hi(), %*_lo() are better than
overloading the nested reloc semantic. It is already somewhat hackyish.

> > > +  /* %dtpoff may only be used immediately inside %hi or %lo, with no
> > > +     other relocations.  However, use inside %hi and %lo is valid even
> > > +     with the old ABI which permits only a single relocation.
> > > +     Similarly, %tpoff may be used inside %hi and %lo even with the
> > > +     old ABI, but may also be used on its own.  Convert these uses to
> > > +     a single relocation and give an error for other uses.  */
> > > +  for (i = 0; i < reloc_index; i++)
> > 
> > I really think there should be one operator per relocation.

Trivial observation: It saves three as_bad() in the parsing code.
That's three possibilities less to make a mistake.

> > On the same topic, it would be nice if the %op() names and R_MIPS_THINGY
> > names were a bit more consistent.  The link between alpha's operator
> > names and relocation names is much more obvious, for example.
> 
> OK.  At this point I think that means renaming the relocations; I just
> renamed the operators more sanely recently.  Anyone have a preference
> on the TPREL vs. TPOFF conventions?

I would prefer REL.


Thiemo



More information about the Binutils mailing list