Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Feb 2010 02:22:59 +0000 (UTC)
From:      Marcel Moolenaar <marcel@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r203946 - head/lib/libc/gen
Message-ID:  <201002160222.o1G2MxVh084980@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: marcel
Date: Tue Feb 16 02:22:59 2010
New Revision: 203946
URL: http://svn.freebsd.org/changeset/base/203946

Log:
  The static TLS size as given by tls_static_space includes TLS_TCB_SIZE
  bytes of TCB in variant I.

Modified:
  head/lib/libc/gen/tls.c

Modified: head/lib/libc/gen/tls.c
==============================================================================
--- head/lib/libc/gen/tls.c	Tue Feb 16 01:44:14 2010	(r203945)
+++ head/lib/libc/gen/tls.c	Tue Feb 16 02:22:59 2010	(r203946)
@@ -137,11 +137,11 @@ __libc_allocate_tls(void *oldtcb, size_t
 	if (oldtcb != NULL && tcbsize == TLS_TCB_SIZE)
 		return (oldtcb);
 
-	tcb = calloc(1, tls_static_space + tcbsize);
+	tcb = calloc(1, tls_static_space + tcbsize - TLS_TCB_SIZE);
 	tls = (Elf_Addr **)(tcb + tcbsize - TLS_TCB_SIZE);
 
 	if (oldtcb != NULL) {
-		memcpy(tls, oldtcb, tls_static_space + TLS_TCB_SIZE);
+		memcpy(tls, oldtcb, tls_static_space);
 		free(oldtcb);
 
 		/* Adjust the DTV. */



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201002160222.o1G2MxVh084980>