From 76658c2a7d8b5391062fefe7269aecbc9b5bc06f Mon Sep 17 00:00:00 2001 From: kientzle Date: Sun, 25 Feb 2007 21:23:50 +0000 Subject: Don't assert() the TLS allocation requested is big enough; just fix the argument. In particular, this is a step towards breaking crt1's dependence on stdio. --- lib/libc/gen/tls.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 5bc4b87..a669f99 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -36,7 +36,6 @@ #include #include #include -#include #include "libc_private.h" @@ -207,7 +206,8 @@ __libc_allocate_tls(void *oldtls, size_t tcbsize, size_t tcbalign) size = round(tls_static_space, tcbalign); - assert(tcbsize >= 2*sizeof(Elf_Addr)); + if (tcbsize < 2 * sizeof(Elf_Addr)) + tcbsize = 2 * sizeof(Elf_Addr); tls = calloc(1, size + tcbsize); dtv = malloc(3 * sizeof(Elf_Addr)); -- cgit v1.1