about summary refs log tree commit diff
diff options
context:
space:
mode:
authorILyoan <ilyoan@gmail.com>2013-03-19 14:28:10 +0900
committerBrian Anderson <banderson@mozilla.com>2013-04-10 18:49:51 -0700
commit03116f251d2d53842971b356fb320f6101d1a3e5 (patch)
treeacceff5af648ee9309161bdac4bc59477014ac23
parenta34948a2c5d7cd296abda6970652a9513d67feb7 (diff)
downloadrust-03116f251d2d53842971b356fb320f6101d1a3e5.tar.gz
rust-03116f251d2d53842971b356fb320f6101d1a3e5.zip
add unwind information on morestack
-rw-r--r--src/rt/arch/arm/morestack.S33
1 files changed, 19 insertions, 14 deletions
diff --git a/src/rt/arch/arm/morestack.S b/src/rt/arch/arm/morestack.S
index 3af8e898cdb..4f1431a3392 100644
--- a/src/rt/arch/arm/morestack.S
+++ b/src/rt/arch/arm/morestack.S
@@ -15,14 +15,19 @@
 
 // r4 and r5 are scratch registers for __morestack due to llvm
 // ARMFrameLowering::adjustForSegmentedStacks() implementation.
-    .align 2
-    .type __morestack,%function
+ .type __morestack,%function
 __morestack:
+	.fnstart
+	// Save frame pointer and return address
+	.save {r4, r5}
+	.save {lr}
+	.save {r6, fp, lr}
+    push {r6, fp, lr}
 
-    // Save frame pointer and return address
-    push {fp, lr}
-    
-    mov fp, sp
+	.movsp r6
+	mov r6, sp
+	.setfp fp, sp, #4
+	add fp, sp, #4
 
     // Save argument registers of the original function
     push {r0, r1, r2, r3, lr}
@@ -47,20 +52,20 @@ __morestack:
     mov pc, r4         // Call the original function
 
     // Switch back to rust stack
-    mov sp, fp
+    mov sp, r6
 
     // Save return value
-    push {r0, r1}
+	mov r4, r0
+	mov r5, r1
 
     // Remove the new allocated stack
     bl upcall_del_stack@plt
 
     // Restore return value
-    pop {r0, r1}
-
+	mov r0, r4
+	mov r1, r5
+	
     // Return
-    pop {fp, lr}
+    pop {r6, fp, lr}
     mov pc, lr
-.endofmorestack:
-    .size   __morestack, .endofmorestack-__morestack
-   
+    .fnend