From 299601a1ef8df4532ded24194c4556e294ab1e6e Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Fri, 25 Apr 2003 09:12:43 +0000 Subject: Update. 2003-04-22 Jakub Jelinek * include/link.h (NO_TLS_OFFSET): Define to 0 if not defined. * elf/dl-close.c (_dl_close): Use NO_TLS_OFFSET. * elf/dl-object.c (_dl_new_object): Initialize l_tls_offset to NO_TLS_OFFSET. * elf/rtld.c (_dl_start_final, _dl_start): Likewise. * elf/dl-reloc.c (CHECK_STATIC_TLS): Use NO_TLS_OFFSET. * sysdeps/generic/dl-tls.c (_dl_allocate_tls_init): Likewise. * sysdeps/powerpc/dl-tls.h (TLS_TPREL_VALUE): Don't subtract TLS_TCB_SIZE. --- linuxthreads/descr.h | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) (limited to 'linuxthreads/descr.h') diff --git a/linuxthreads/descr.h b/linuxthreads/descr.h index 2dcb37642a..dd496f6d0f 100644 --- a/linuxthreads/descr.h +++ b/linuxthreads/descr.h @@ -120,17 +120,14 @@ struct _pthread_descr_struct union dtv *dtvp; pthread_descr self; /* Pointer to this structure */ int multiple_threads; -#ifdef NEED_DL_SYSINFO +# define p_multiple_threads(descr) (descr)->p_header.data.multiple_threads +# ifdef NEED_DL_SYSINFO uintptr_t sysinfo; -#endif +# endif } data; void *__padding[16]; } p_header; -# define p_multiple_threads p_header.data.multiple_threads -#elif TLS_MULTIPLE_THREADS_IN_TCB - int p_multiple_threads; #endif - pthread_descr p_nextlive, p_prevlive; /* Double chaining of active threads */ pthread_descr p_nextwaiting; /* Next element in the queue holding the thr */ @@ -189,7 +186,22 @@ struct _pthread_descr_struct #endif size_t p_alloca_cutoff; /* Maximum size which should be allocated using alloca() instead of malloc(). */ - /* New elements must be added at the end. */ + /* New elements must be added at the end before __multiple_threads. */ +#if TLS_MULTIPLE_THREADS_IN_TCB + /* This field here isn't necessarily multiple_threads, which is really + the last integer in struct _pthread_descr_struct. */ + int __multiple_threads; +# define p_multiple_threads(descr) \ + (((union \ + { \ + struct _pthread_descr_struct s; \ + struct \ + { \ + char dummy[sizeof (struct _pthread_descr_struct) - sizeof (int)]; \ + int multiple_threads; \ + } m; \ + } *)(descr))->m.multiple_threads) +#endif } __attribute__ ((aligned(32))); /* We need to align the structure so that doubles are aligned properly. This is 8 bytes on MIPS and 16 bytes on MIPS64. -- cgit v1.2.3