mirror of
https://github.com/freebsd/freebsd-src.git
synced 2024-12-01 02:03:31 +00:00
The static TLS size as given by tls_static_space includes TLS_TCB_SIZE
bytes of TCB in variant I.
This commit is contained in:
parent
45d9abdbc3
commit
9436852167
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=203946
@ -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. */
|
||||
|
Loading…
Reference in New Issue
Block a user