Move memtag_stack out of libc_globals
We cannot use a WriteProtected because we are accessing it in a
multithreaded context.
Test: atest memtag_stack_dlopen_test w/ MTE
Test: atest bionic-unit-tests w/ MTE
Test: atest bionic-unit-tests on _fullmte
Bug: 328256432
Change-Id: I39faa75f97fd5b3fb755a46e88346c17c0e9a8e2
diff --git a/libc/bionic/pthread_create.cpp b/libc/bionic/pthread_create.cpp
index 194db18..5bd4f16 100644
--- a/libc/bionic/pthread_create.cpp
+++ b/libc/bionic/pthread_create.cpp
@@ -91,7 +91,7 @@
// Create and set an alternate signal stack.
int prot = PROT_READ | PROT_WRITE;
#ifdef __aarch64__
- if (atomic_load(&__libc_globals->memtag_stack)) {
+ if (atomic_load(&__libc_memtag_stack)) {
prot |= PROT_MTE;
}
#endif
@@ -237,7 +237,7 @@
int prot = PROT_READ | PROT_WRITE;
const char* prot_str = "R+W";
#ifdef __aarch64__
- if (atomic_load(&__libc_globals->memtag_stack)) {
+ if (atomic_load(&__libc_memtag_stack)) {
prot |= PROT_MTE;
prot_str = "R+W+MTE";
}