Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corert.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPetr Bred <bredpetr@gmail.com>2017-10-30 18:36:15 +0300
committerJan Kotas <jkotas@microsoft.com>2017-10-30 18:36:15 +0300
commit32c17228dea98ba5428a8dc5419170904c69a13b (patch)
tree3d073410693c6857b2cb05f46269abb55f766224 /src/Native
parent0dddbe2192af67d441a773b7469eea6b3059359d (diff)
ARM32: Fix RhCommonStub and RhGetCurrentThunkContext (#4833)
- the bug occurred when we jumped into __tls_get_addr, it overwrites our LR register. Signed-off-by: Petr Bred <bredpetr@gmail.com>
Diffstat (limited to 'src/Native')
-rw-r--r--src/Native/Runtime/arm/InteropThunksHelpers.S8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/Native/Runtime/arm/InteropThunksHelpers.S b/src/Native/Runtime/arm/InteropThunksHelpers.S
index ac8da0b10..9021e7c81 100644
--- a/src/Native/Runtime/arm/InteropThunksHelpers.S
+++ b/src/Native/Runtime/arm/InteropThunksHelpers.S
@@ -18,7 +18,7 @@ NESTED_ENTRY RhCommonStub, _TEXT, NoHandler
// red zone has pointer to the current thunk's data block (data contains 2 pointer values: context + target pointers)
// Copy red zone value into r12 so that the PROLOG_PUSH doesn't destroy it
ldr r12, [sp, #-4]
- PROLOG_PUSH "{r0-r5}"
+ PROLOG_PUSH "{r0-r4, lr}"
PROLOG_VPUSH {d0-d7} // Capture the floating point argument registers
mov r4, r12
@@ -34,7 +34,7 @@ NESTED_ENTRY RhCommonStub, _TEXT, NoHandler
// Now load the target address and jump to it.
ldr r12, [r4, #POINTER_SIZE]
EPILOG_VPOP {d0-d7}
- EPILOG_POP "{r0-r5}"
+ EPILOG_POP "{r0-r4, lr}"
bx r12
NESTED_END RhCommonStub, _TEXT
@@ -52,8 +52,10 @@ LEAF_END RhGetCommonStubAddress, _TEXT
//
LEAF_ENTRY RhGetCurrentThunkContext, _TEXT
+ PROLOG_PUSH "{r12, lr}"
+
INLINE_GET_TLS_VAR tls_thunkData
ldr r0, [r0]
- bx lr
+ EPILOG_POP "{r12, pc}"
LEAF_END RhGetCurrentThunkContext, _TEXT