This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] TLS_DTV_AT_TP - Don't claim struct pthread twice
- From: Tom de Vries <Tom_deVries at mentor dot com>
- To: Carlos O'Donell <carlos at systemhalted dot org>
- Cc: GLIBC Devel <libc-alpha at sourceware dot org>
- Date: Sat, 11 May 2013 12:03:25 +0200
- Subject: [PATCH] TLS_DTV_AT_TP - Don't claim struct pthread twice
Carlos,
For TLS_DTV_AT_TP architectures, the initialization of stacktop to
(char *) (pd - 1) in allocate_stack claims unused space the size of struct
pthread. The space used for struct pthread is pointed to by pd.
This patch removes the claiming of unused space.
I tested the patch on MIPS qemu (mips-linux-gnu) with host i686-pc-linux-gnu, no
issues found.
OK to apply?
2013-05-10 Tom de Vries <tom@codesourcery.com>
* allocatestack.c [TLS_DTV_AT_TP] (allocate_stack): Don't claim struct
pthread twice.
diff --git a/nptl/allocatestack.c b/nptl/allocatestack.c
index 56bf257..a4efaa3 100644
--- a/nptl/allocatestack.c
+++ b/nptl/allocatestack.c
@@ -714,7 +714,7 @@ allocate_stack (const struct pthread_attr *attr, struct pthread **pdp,
/* The stack begins before the TCB and the static TLS block. */
stacktop = ((char *) (pd + 1) - __static_tls_size);
#elif TLS_DTV_AT_TP
- stacktop = (char *) (pd - 1);
+ stacktop = (char *) pd;
#endif
#ifdef NEED_SEPARATE_REGISTER_STACK