[mips-tls] Revised versions of MIPS TLS ABI specification
Nigel Stephens
nigel at mips.com
Thu Nov 4 18:30:20 UTC 2004
Mark Mitchell wrote:
> Daniel Jacobowitz wrote:
>
>> So for local dynamic, offsets would be biased by 0x8000 instead of 0;
>> for initial exec, offsets would be biased by -0x7000 instead of +8.
>> This leaves room for the pthread descriptor to be accessed in a single
>> instruction as long as it is no more than 4k-8 bytes.
>>
>> Shall we use this model?
>>
>>
> It's OK by me. Are there any special values (0x7ff0 was mentioned?)
> that make more sense than just 0x8000 and -0x7000, due to the specific
> way in which MIPS hardware works? Or, which would be easier to
> implement because the linker, etc., are already set up to deal with them?
I think this was suggested because 0x7ff0 is currently used by the
linker as the offset of the $gp register from the start of the small
data region. It's probably this value to ensure that a reference to the
sub-words of a larger variable is safe to break down into gp-relative
offsets, without causing an underflow below -0x8000, for the largest
possible directly loadable scalar (a "long double"). Thiemo may know a
better reason :-).
But I don't think that causes us a problem with the suggested 0x7000
offset: the resulting range of offsets from -0x7000 up to 0x7fff will
work fine on MIPS, but care will be needed when accessing the "private"
thread data stored in the 4KB region below the TCB, to make sure that it
cannot underflow.
Nigel
More information about the mips-tls
mailing list