JMP runtime·goPanicExtendSlice3CU(SB)
#ifdef GOOS_android
+// Use the free TLS_SLOT_APP slot #2 on Android Q.
+// Earlier androids are set up in gcc_android.c.
+DATA runtime·tls_g+0(SB)/4, $8
GLOBL runtime·tls_g+0(SB), NOPTR, $4
#endif
JMP runtime·goPanicSlice3CU(SB)
#ifdef GOOS_android
+// Use the free TLS_SLOT_APP slot #2 on Android Q.
+// Earlier androids are set up in gcc_android.c.
+DATA runtime·tls_g+0(SB)/8, $16
GLOBL runtime·tls_g+0(SB), NOPTR, $8
#endif
{
pthread_key_t k;
int i, err;
- void *handle, *get_ver;
+ void *handle, *get_ver, *off;
// Check for Android Q where we can use the free TLS_SLOT_APP slot.
handle = dlopen("libc.so", RTLD_LAZY);
get_ver = dlsym(handle, "android_get_device_api_level");
dlclose(handle);
if (get_ver != NULL) {
- *tlsg = (void *)(TLS_SLOT_APP*sizeof(void *));
+ off = (void *)(TLS_SLOT_APP*sizeof(void *));
+ // tlsg is initialized to Q's free TLS slot. Verify it while we're here.
+ if (*tlsg != off) {
+ fatalf("tlsg offset wrong, got %ld want %ld\n", *tlsg, off);
+ }
return;
}
B runtime·save_g(SB)
#ifdef TLSG_IS_VARIABLE
+#ifdef GOOS_android
+// Use the free TLS_SLOT_APP slot #2 on Android Q.
+// Earlier androids are set up in gcc_android.c.
+DATA runtime·tls_g+0(SB)/4, $8
+#endif
GLOBL runtime·tls_g+0(SB), NOPTR, $4
#else
GLOBL runtime·tls_g+0(SB), TLSBSS, $4
RET
#ifdef TLSG_IS_VARIABLE
+#ifdef GOOS_android
+// Use the free TLS_SLOT_APP slot #2 on Android Q.
+// Earlier androids are set up in gcc_android.c.
+DATA runtime·tls_g+0(SB)/8, $16
+#endif
GLOBL runtime·tls_g+0(SB), NOPTR, $8
#else
GLOBL runtime·tls_g+0(SB), TLSBSS, $8