diff options
author | dfr <dfr@FreeBSD.org> | 2004-08-18 10:18:58 +0000 |
---|---|---|
committer | dfr <dfr@FreeBSD.org> | 2004-08-18 10:18:58 +0000 |
commit | a26ab6440d4629ff5d921e6128cd7185157b09f8 (patch) | |
tree | 461a1f0e7415d3f35262d245cc6ee86e61473112 /lib/libc | |
parent | 5ea2d5f70f53ce23ed73542d825394afa161fad8 (diff) | |
download | FreeBSD-src-a26ab6440d4629ff5d921e6128cd7185157b09f8.zip FreeBSD-src-a26ab6440d4629ff5d921e6128cd7185157b09f8.tar.gz |
Always allocate a TLS area even if its empty - libpthread relies on
having a valid %gs when it initialises.
MFC after: 2 days
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/tls.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lib/libc/gen/tls.c b/lib/libc/gen/tls.c index 59e44b7..7a3ebfe 100644 --- a/lib/libc/gen/tls.c +++ b/lib/libc/gen/tls.c @@ -239,6 +239,7 @@ _init_tls() Elf_Phdr *phdr; size_t phent, phnum; int i; + void *tls; sp = (Elf_Addr *) environ; while (*sp++ != 0) @@ -280,13 +281,9 @@ _init_tls() } } - if (tls_static_space > 0) { - void* tls; + tls = _rtld_allocate_tls(NULL, 2*sizeof(Elf_Addr), + sizeof(Elf_Addr)); - tls = _rtld_allocate_tls(NULL, 2*sizeof(Elf_Addr), - sizeof(Elf_Addr)); - - _set_tp(tls); - } + _set_tp(tls); #endif } |