Skip to content

Commit

Permalink
Fix Arm64 Emulated TLS (#77475)
Browse files Browse the repository at this point in the history
Fix missing ifdef FEATURE_EMULATED_TLS introduced by #73216 for Android Arm64
  • Loading branch information
josephmoresena authored and MichalStrehovsky committed Oct 29, 2022
1 parent a657427 commit 9684197
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/coreclr/nativeaot/Runtime/arm64/GcProbe.S
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,11 @@ PROBE_FRAME_SIZE = 0xD0 // 4 * 8 for fixed part of PInvokeTransitionFrame (fp,
.macro FixupHijackedCallstack

// x2 <- GetThread()
#ifdef FEATURE_EMULATED_TLS
GETTHREAD_ETLS_2
#else
INLINE_GETTHREAD x2
#endif

//
// Fix the stack by restoring the original return address
Expand Down
11 changes: 11 additions & 0 deletions src/coreclr/nativeaot/Runtime/unix/unixasmmacrosarm64.inc
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,17 @@ C_FUNC(\Name):
EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, 32
.endm

.macro GETTHREAD_ETLS_2
PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -32 // ;; Push down stack pointer and store FP and LR
stp x0, x1, [sp, #0x10]

bl C_FUNC(RhpGetThread)
mov x2, x0

ldp x0, x1, [sp, #0x10]
EPILOG_RESTORE_REG_PAIR_INDEXED fp, lr, 32
.endm

.macro GETTHREAD_ETLS_3
PROLOG_SAVE_REG_PAIR_INDEXED fp, lr, -48 // ;; Push down stack pointer and store FP and LR
stp x0, x1, [sp, #0x10]
Expand Down

0 comments on commit 9684197

Please sign in to comment.