diff options
author | kientzle <kientzle@FreeBSD.org> | 2007-02-25 21:23:50 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2007-02-25 21:23:50 +0000 |
commit | 76658c2a7d8b5391062fefe7269aecbc9b5bc06f (patch) | |
tree | a826bbcf4544e2c21efa8cdb5addbda9fa6022b6 /lib/libc/gen/tls.c | |
parent | 99b9ebd3eb5f966446b23a840bf5eaa16e5f204d (diff) | |
download | FreeBSD-src-76658c2a7d8b5391062fefe7269aecbc9b5bc06f.zip FreeBSD-src-76658c2a7d8b5391062fefe7269aecbc9b5bc06f.tar.gz |
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.
Diffstat (limited to 'lib/libc/gen/tls.c')
-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 5bc4b87..a669f99 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -36,7 +36,6 @@ #include <stdlib.h> #include <string.h> #include <elf.h> -#include <assert.h> #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)); |