about summary refs log tree commit diff
path: root/src/rt
diff options
context:
space:
mode:
authorBrian Anderson <banderson@mozilla.com>2011-12-01 20:56:05 -0800
committerBrian Anderson <banderson@mozilla.com>2011-12-01 20:56:05 -0800
commit691b517fb9e18e190763a8ac83e09f1cffa6cf11 (patch)
tree1c6f1b4a33e37c6cafdced64b53ead95dad9efb9 /src/rt
parent2511299024fcf15d8febe98869c1523771a990e3 (diff)
downloadrust-691b517fb9e18e190763a8ac83e09f1cffa6cf11.tar.gz
rust-691b517fb9e18e190763a8ac83e09f1cffa6cf11.zip
rt: Fix 64-bit linux __morestack
Diffstat (limited to 'src/rt')
-rw-r--r--src/rt/arch/x86_64/morestack.S28
1 files changed, 26 insertions, 2 deletions
diff --git a/src/rt/arch/x86_64/morestack.S b/src/rt/arch/x86_64/morestack.S
index 9b8f2fe9180..652cf098068 100644
--- a/src/rt/arch/x86_64/morestack.S
+++ b/src/rt/arch/x86_64/morestack.S
@@ -50,10 +50,20 @@
 
 #if defined(__linux__) || defined(__APPLE__)
 MORESTACK:
-
-	# Set up a normal backtrace
+#if defined(__ELF__)
+	.cfi_startproc
+#endif
+	
+	// Set up a normal backtrace
+#if defined(__ELF__)
 	pushq %rbp
+	.cfi_def_cfa_offset 16
+	.cfi_offset %rbp, -16
+#endif
 	movq %rsp, %rbp
+#if defined(__ELF__)
+	.cfi_def_cfa_register %rbp
+#endif
 
 	// FIXME: libgcc also saves rax. not sure if we need to
 
@@ -77,7 +87,12 @@ MORESTACK:
 
 	movq UPCALL_NEW_STACK@GOTPCREL(%rip), %rsi
 	movq %rsp, %rdi
+#ifdef __APPLE__
 	call UPCALL_CALL_C@GOTPCREL
+#endif
+#ifdef __linux__
+	call UPCALL_CALL_C@PLT
+#endif
 
 	// Pop the new_stack_args struct
 	addq $24, %rsp
@@ -104,12 +119,21 @@ MORESTACK:
 	
 	movq UPCALL_DEL_STACK@GOTPCREL(%rip), %rsi
 	movq $0, %rdi
+#ifdef __APPLE__
 	call UPCALL_CALL_C@GOTPCREL
+#endif
+#ifdef __linux__
+	call UPCALL_CALL_C@PLT
+#endif
 
 	addq $8, %rsp
 	popq %rbp
 	ret
 	
+#if defined(__ELF__)
+	.cfi_endproc
+#endif
+
 #else
 MORESTACK:
 	ret