This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
Re: PATCH: NPTL support for MIPS
On Wed, Mar 16, 2005 at 03:25:20PM -0800, Roland McGrath wrote:
> > This is entirely within LinuxThreads. Both libc.so and libpthread.so
> > will try to access p_errno, which has to be at a common offset in this
> > structure. This "padding" is unused in libc.so, but used in
> > libpthread.so, and it lives before p_errno - so when it isn't included,
> > libc clobbers the wrong location in the descriptor when it tries to set
> > errno.
>
> Why is it located there?
#if !defined USE_TLS || !TLS_DTV_AT_TP
/* This overlaps tcbhead_t (see tls.h), as used for TLS without threads. */
union
{
struct
{
void *tcb; /* Pointer to the TCB. This is not always
the address of this thread descriptor. */
union dtv *dtvp;
pthread_descr self; /* Pointer to this structure */
int multiple_threads;
# ifdef NEED_DL_SYSINFO
uintptr_t sysinfo;
# endif
} data;
void *__padding[16];
} p_header;
Because if !TLS_DTV_AT_TP, this is the TCB, so it has to be first. But
MIPS does use TLS_DTV_AT_TP when using TLS, so it is unnecessary.
BTW, could you remove this now-empty file from CVS?
sysdeps/unix/sysv/linux/mips/mips32/kern64/sysdep.h
--
Daniel Jacobowitz
CodeSourcery, LLC