This is the mail archive of the libc-alpha@sources.redhat.com mailing list for the glibc 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: [PATCH] PPC linuxthreads tls.h fix


> 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.


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