From f9a0999237bd6aa5562d3c978bda855cdf318a7b Mon Sep 17 00:00:00 2001 From: tkchia Date: Wed, 10 Aug 2022 18:53:18 +0000 Subject: [PATCH] Get __get_tls_privileged() working on bare metal --- libc/nexgen32e/gettls.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libc/nexgen32e/gettls.h b/libc/nexgen32e/gettls.h index 212ef9b90..e9a930989 100644 --- a/libc/nexgen32e/gettls.h +++ b/libc/nexgen32e/gettls.h @@ -27,7 +27,7 @@ static noasan inline char *__get_tls(void) { */ static noasan inline char *__get_tls_privileged(void) { char *tib, *lin = (char *)0x30; - if (IsLinux() || IsFreebsd() || IsNetbsd() || IsOpenbsd()) { + if (IsLinux() || IsFreebsd() || IsNetbsd() || IsOpenbsd() || IsMetal()) { asm("mov\t%%fs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory"); } else { asm("mov\t%%gs:(%1),%0" : "=a"(tib) : "r"(lin) : "memory");