mirror of
https://github.com/jart/cosmopolitan.git
synced 2025-07-04 18:28:30 +00:00
Add back missing TlsAlloc() call
Cosmopolitan Libc once called this important function although somewhere along the way, possibly in a refactoring, it got removed and __tls_alloc has always been zero ever since.
This commit is contained in:
parent
e08a4cd99e
commit
5d2d9e9640
5 changed files with 12 additions and 9 deletions
|
@ -17,9 +17,8 @@ forceinline struct CosmoTib *__get_tls_privileged(void) {
|
|||
__asm__("mov\t%%fs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
|
||||
} else {
|
||||
__asm__("mov\t%%gs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
|
||||
if (IsWindows()) {
|
||||
if (IsWindows())
|
||||
tib = *(char **)(tib + 0x1480 + __tls_index * 8);
|
||||
}
|
||||
}
|
||||
return (struct CosmoTib *)tib;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue