Always allocate a TLS area even if its empty - libpthread relies on

having a valid %gs when it initialises.

MFC after: 2 days
This commit is contained in:
Doug Rabson 2004-08-18 10:18:58 +00:00
parent 4233992afa
commit 0e7e4e5fd6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=133949

View file

@ -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
}