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. */
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "[email protected]"

Reply via email to