mirror of
https://git.FreeBSD.org/src.git
synced 2024-12-24 11:29:10 +00:00
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.
This commit is contained in:
parent
b141b9655f
commit
0031cdf4d7
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=166995
@ -36,7 +36,6 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <elf.h>
|
#include <elf.h>
|
||||||
#include <assert.h>
|
|
||||||
|
|
||||||
#include "libc_private.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);
|
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);
|
tls = calloc(1, size + tcbsize);
|
||||||
dtv = malloc(3 * sizeof(Elf_Addr));
|
dtv = malloc(3 * sizeof(Elf_Addr));
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user