ARM/Linux: Fix Exception Handler PAL Test Fail (#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 #5358

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

index b7140e8aa46f96d0e079a27fce77738020e2d646..d7f85e704168f2cfa0fd35fc2e8e69783f853109 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