[arm] Respect the ios abi on tls thunks
authorVlad Brezae <brezaevlad@gmail.com>
Fri, 4 Dec 2015 20:57:13 +0000 (15:57 -0500)
committerVlad Brezae <brezaevlad@gmail.com>
Mon, 7 Dec 2015 20:26:06 +0000 (15:26 -0500)
mono/mini/mini-arm-tls.S

index f4fd3e0d073deb514aafe6131e562dc8b0c13298..63096e7439f6f435a68f47d3a0d7f3cc2c9c6fe5 100644 (file)
@@ -57,17 +57,22 @@ DECLARE_GLOBAL_SYMBOL mono_fast_get_tls_key_end
 
        .align 4
 DECLARE_GLOBAL_SYMBOL mono_fallback_get_tls_key
-       push    {lr}
 #if defined(__linux__) && defined(HAVE_KW_THREAD) && defined(__ARM_EABI__)
+       push    {lr}
        mov     r1, r0
        bl      __aeabi_read_tp
        ldr     r0, [r0, r1]
+       pop     {pc}
 #elif defined(TARGET_IOS)
+       push    {r7, lr}
+       mov     r7, sp
        bl      _pthread_getspecific
+       pop     {r7, pc}
 #elif defined(TARGET_ANDROID)
+       push    {lr}
        bl      pthread_getspecific
-#endif
        pop     {pc}
+#endif
        /*
         * The following thunks set the value corresponding to the key/offset
         * passed in R0. These thunks don't do jumps to external code so execution
@@ -100,17 +105,22 @@ DECLARE_GLOBAL_SYMBOL mono_fast_set_tls_key_end
 
        .align 4
 DECLARE_GLOBAL_SYMBOL mono_fallback_set_tls_key
-       push    {lr}
 #if defined(__linux__) && defined(HAVE_KW_THREAD) && defined(__ARM_EABI__)
+       push    {lr}
        mov     r2, r0
        bl      __aeabi_read_tp
        str     r1, [r0, r2]
+       pop     {pc}
 #elif defined(TARGET_IOS)
+       push    {r7, lr}
+       mov     r7, sp
        bl      _pthread_setspecific
+       pop     {r7, pc}
 #elif defined(TARGET_ANDROID)
+       push    {lr}
        bl      pthread_setspecific
-#endif
        pop     {pc}
+#endif
 
 
        /* Additional tls getters/setters */