Revert "Use %gs as TLS register when dlopen() is linked"

This reverts commit d71da7fc72.
This commit is contained in:
Justine Tunney 2023-11-08 01:33:01 -08:00
parent d71da7fc72
commit 956e68be59
No known key found for this signature in database
GPG key ID: BE714B4575D6E328
13 changed files with 40 additions and 71 deletions

View file

@ -15,11 +15,7 @@ COSMOPOLITAN_C_START_
__funline struct CosmoTib *__get_tls_privileged(void) {
char *tib, *lin = (char *)0x30;
if (IsLinux() || IsFreebsd() || IsNetbsd() || IsOpenbsd() || IsMetal()) {
if (!__tls_morphed) {
asm("mov\t%%fs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
} else {
asm("mov\t%%gs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");
}
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()) {