ARM/Linux: Fix Exception Handler PAL Test Fail (dotnet/coreclr#5360)
authorMyungJoo Ham <myungjoo.ham@gmail.com>
Wed, 1 Jun 2016 10:22:10 +0000 (19:22 +0900)
committerJan Kotas <jkotas@microsoft.com>
Wed, 1 Jun 2016 10:22:10 +0000 (03:22 -0700)
The return address should be kept intact, not recovered
just yet. It is going to be recovered by libgcc's
rescore_core_regs much later, few instructions before
heading back to "catch".

Fixes dotnet/coreclr#5358

Commit migrated from https://github.com/dotnet/coreclr/commit/594b424e1328135049cf0515bc5fc58b91f07e2a

src/coreclr/src/pal/src/arch/arm/exceptionhelper.S

index b7140e8..d7f85e7 100644 (file)
@@ -22,12 +22,12 @@ LEAF_ENTRY ThrowExceptionFromContextInternal, _TEXT
     ldr        r10,    [r0, #(CONTEXT_R10)]
     ldr        r11,    [r0, #(CONTEXT_R11)]
     ldr        sp,     [r0, #(CONTEXT_Sp)]
-    ldr        lr,     [r0, #(CONTEXT_Lr)]
 
     ldr        r2,     [r0, #(CONTEXT_Pc)]
 
     // Store return address to the stack
-    push    {r2}
+    // Added r7 as a dummy to keep the stack aligned by 8 bytes.
+    push    {r2, r7}
 
     // The PAL_SEHException pointer
     mov        r0,     r1