Jakub Jelinek jakub@redhat.com
Mon Jan 20 13:41:00 GMT 2003

On Tue, Jan 21, 2003 at 12:01:47AM +1030, Alan Modra wrote:
> On Sat, Jan 18, 2003 at 10:52:34AM +0100, Jakub Jelinek wrote:
> > Well, you could have _pthread_descr at the negative offsets from the TP
> > and have more than 32K of quickly accessable TLS data too:
> > if the ABI says that says that r13[-0x7000] is the DTV pointer,
> > then you have 60K-sizeof(tcbhead_t) big "fast" TLS area and
> > those 4K should be enough for the thread implementation to
> > have some of its most important data stored there (well, for linuxthreads
> > or NPTL the whole thread structure would easily fit).
> I think I'll settle for r13 - 0x7000 at the _end_ of the TCB.  That
> way the toolchain won't have to know about the size of the TCB when
> deciding whether a particular addressing scheme works for a given
> offset.  Knowledge about the TCB and any other thread structures can
> stay nicely in glibc.

Good idea. Additional benefit is that if ET_EXEC's PT_TLS segment
has p_align > 16, there won't be space wasted in the precious TLS space
(on IA-64 say 128 byte aligned ET_EXEC's PT_TLS is required to be at offset
128 while on PPC64 could be at 0).


More information about the Binutils mailing list