This is the mail archive of the libc-alpha@sourceware.org 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]

[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

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