diff options
author | marcel <marcel@FreeBSD.org> | 2010-02-16 02:22:59 +0000 |
---|---|---|
committer | marcel <marcel@FreeBSD.org> | 2010-02-16 02:22:59 +0000 |
commit | 56cf56f59df60dc691d2efd078049223c846a9e6 (patch) | |
tree | 0fadb65ece18058183ed886d37c7dd8943c6228c /lib/libc | |
parent | 2eef358f95b1d0007763b79eccbfd763da55fa64 (diff) | |
download | FreeBSD-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/libc')
-rw-r--r-- | lib/libc/gen/tls.c | 4 |
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. */ |