From: Rich Felker Date: Fri, 19 Oct 2012 05:33:52 +0000 (-0400) Subject: fix crashes in static-linked multithreaded programs without TLS X-Git-Url: http://nsz.repo.hu/git/?p=musl;a=commitdiff_plain;h=ebee8c2b477807fe58fd35d35783633ea08b049c fix crashes in static-linked multithreaded programs without TLS --- diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c index ab5992ce..c341bfc1 100644 --- a/src/env/__init_tls.c +++ b/src/env/__init_tls.c @@ -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)