mirror of
git://git.musl-libc.org/musl
synced 2025-02-21 05:16:50 +00:00
fix crashes in static-linked multithreaded programs without TLS
This commit is contained in:
parent
6a04d1b8c6
commit
ebee8c2b47
2
src/env/__init_tls.c
vendored
2
src/env/__init_tls.c
vendored
@ -60,6 +60,8 @@ void __init_tls(size_t *aux)
|
||||
Phdr *phdr, *tls_phdr=0;
|
||||
size_t base = 0;
|
||||
|
||||
libc.tls_size = sizeof(struct pthread);
|
||||
|
||||
for (p=(void *)aux[AT_PHDR],n=aux[AT_PHNUM]; n; n--,p+=aux[AT_PHENT]) {
|
||||
phdr = (void *)p;
|
||||
if (phdr->p_type == PT_PHDR)
|
||||
|
Loading…
Reference in New Issue
Block a user