summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/libc/gen/tls.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c
index 7a3ebfe4d2f9..69489125eae1 100644
--- a/lib/libc/gen/tls.c
+++ b/lib/libc/gen/tls.c
@@ -109,6 +109,8 @@ _rtld_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign)
Elf_Addr *dtv;
size = tls_static_space;
+ if (size < tcbsize)
+ size = tcbsize;
tls = malloc(size);
dtv = malloc(3 * sizeof(Elf_Addr));