summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormarcel <marcel@FreeBSD.org>2010-02-16 02:22:59 +0000
committermarcel <marcel@FreeBSD.org>2010-02-16 02:22:59 +0000
commit56cf56f59df60dc691d2efd078049223c846a9e6 (patch)
tree0fadb65ece18058183ed886d37c7dd8943c6228c /lib
parent2eef358f95b1d0007763b79eccbfd763da55fa64 (diff)
downloadFreeBSD-src-56cf56f59df60dc691d2efd078049223c846a9e6.zip
FreeBSD-src-56cf56f59df60dc691d2efd078049223c846a9e6.tar.gz
The static TLS size as given by tls_static_space includes TLS_TCB_SIZE
bytes of TCB in variant I.
Diffstat (limited to 'lib')
-rw-r--r--lib/libc/gen/tls.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c
index 2756e94..9d84679 100644
--- a/lib/libc/gen/tls.c
+++ b/lib/libc/gen/tls.c
@@ -137,11 +137,11 @@ __libc_allocate_tls(void *oldtcb, size_t tcbsize, size_t tcbalign __unused)
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. */
OpenPOWER on IntegriCloud