This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC 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 tls with -mlong64/-mgp32


DJ Delorie <dj@redhat.com> writes:
>> The address is doubleword aligned, so it is OK.  But I'd just remembered
>> that the REL TLS relocs have no %hi/%lo addend pairing, so my suggestion
>> was indeed wrong on its own.  I suppose that even if we extended the
>> relocs, we'd still have to cope with old binutils.  Ugh.
>
> I tested my original patch (with DTPREL) with 80 different mips
> multilibs (gcc's testsuite), and it seems to work OK.  The m->o patch
> didn't.

But the original patch was wrong.  You can't assume anything +4 is
valid.  It is OK in your particular case because the decl you're
using it for is 8-byte aligned, but not all TLS data is 8-byte aligned.

I suppose that the m->o thing didn't work because the address isn't
considered to be mode-dependent.  We should either make it mode-dependent,
or check whether the offset is within the alignment of the SYMBOL_REF_DECL.
The latter should be enough for TLS symbols, and is probably better.

richard


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