X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fenv%2F__init_tls.c;h=3a1b1f56cb52e996226799bec0b5db8f62548fe3;hb=2ad9cf52eb9fea12a19bcf893828e1361a0b6546;hp=ab5992ce1c928eaccddc44bd8f301f2a5b98a981;hpb=9ec4283b28cf676292fd5c6f681bef1e90e30c18;p=musl diff --git a/src/env/__init_tls.c b/src/env/__init_tls.c index ab5992ce..3a1b1f56 100644 --- a/src/env/__init_tls.c +++ b/src/env/__init_tls.c @@ -1,5 +1,7 @@ #include #include +#include +#include #include "pthread_impl.h" #include "libc.h" #include "atomic.h" @@ -56,10 +58,12 @@ typedef Elf64_Phdr Phdr; void __init_tls(size_t *aux) { unsigned char *p, *mem; - size_t n, d; + size_t n; 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)