This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: [PATCH] PPC linuxthreads tls.h fix
- From: Paul Mackerras <paulus at au1 dot ibm dot com>
- To: Roland McGrath <roland at redhat dot com>
- Cc: sjmunroe at vnet dot ibm dot com,libc-alpha <libc-alpha at sources dot redhat dot com>,Franz-Sirl <Franz-Sirl at lauterbach dot com>,Alan Modra <amodra at bigpond dot net dot au>
- Date: Fri, 28 Feb 2003 15:06:52 +1100
- Subject: Re: [PATCH] PPC linuxthreads tls.h fix
- References: <15966.46250.335708.432629@argo.ozlabs.ibm.com><200302280203.h1S23fw01896@magilla.sf.frob.com>
> That is not strictly necessary, even all else being unchanged. The word
> after the DTV is called "the TCB pointer" in the TLS spec, but is
> effectively specified as opaque and private to the implementation as I
> understand it. We do not use this word for anything now (instead, our
> private TCB data structure is located just prior to the word containing the
> DTV, i.e. at a negative offset from the thread register), so it could be
> stolen for that. However, in a USE_TLS build it can always use negative
> offsets to use the private descriptor instead.
I couldn't get linuxthreads/sysdeps/powerpc/tcb-offsets.sym to
generate offsets relating to the _pthread_descr_struct. To get to the
multiple_threads field in the pthread_descr, I would need:
offsetof(struct _pthread_descr_struct, p_header.data.multiple_threads))
- sizeof(struct _pthread_descr_struct) - TLS_TCB_SIZE
I tried #include <linuxthreads/descr.h> and #include <descr.h> but I
still got struct _pthread_descr_struct undefined. Also, putting a #if
inside tcb-offsets.sym gave invalid C from the awk script.
> > In the non-TLS case the tcbhead_t overlays the start of the
> > _pthread_descr_struct, and pthread_handle_create will set the
> > multiple_threads field for us.
>
> I wonder if perhaps we should change this to have a consistent ABI for the
> thread register and the data structure around it, between TLS and non-TLS
> builds.
Sounds like a good idea. :)
Paul.