about summary refs log tree commit diff
path: root/sysdeps/unix/sysv/linux/sh/makecontext.S
diff options
context:
space:
mode:
authorThomas Schwinge <thomas@codesourcery.com>2012-06-23 12:11:13 +0200
committerThomas Schwinge <thomas@codesourcery.com>2012-06-23 12:11:13 +0200
commit58f902b8d8cd47e8f4f2fcd64721a6289400422e (patch)
tree277378f362df2bfad4fd4b8758136a69bb05b267 /sysdeps/unix/sysv/linux/sh/makecontext.S
parent1518f58b6120289e69aeba9426eca9234cd9a200 (diff)
downloadglibc-58f902b8d8cd47e8f4f2fcd64721a6289400422e.tar.gz
glibc-58f902b8d8cd47e8f4f2fcd64721a6289400422e.tar.xz
glibc-58f902b8d8cd47e8f4f2fcd64721a6289400422e.zip
SH: Preserve more registers for frame unwinding purposes, add CFI directives.
Diffstat (limited to 'sysdeps/unix/sysv/linux/sh/makecontext.S')
-rw-r--r--sysdeps/unix/sysv/linux/sh/makecontext.S12
1 files changed, 11 insertions, 1 deletions
diff --git a/sysdeps/unix/sysv/linux/sh/makecontext.S b/sysdeps/unix/sysv/linux/sh/makecontext.S
index ec9ce91693..a04bc9f635 100644
--- a/sysdeps/unix/sysv/linux/sh/makecontext.S
+++ b/sysdeps/unix/sysv/linux/sh/makecontext.S
@@ -97,8 +97,12 @@ ENTRY(__makecontext)
 	cfi_endproc
 
 	.align	5
+	cfi_startproc
 .Lexitcode:
 #ifdef PIC
+	mov.l	r12, @-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (r12, 0)
 	mova	.Lgot, r0
 	mov.l	.Lgot, r12
 	add	r0, r12
@@ -107,6 +111,9 @@ ENTRY(__makecontext)
 	bt/s	2f
 	 mov	r8, r4		/* r4 <- ucb->uc_link */
 	mov.l	.Lsetcontext, r1
+	sts.l	pr, @-r15
+	cfi_adjust_cfa_offset (4)
+	cfi_rel_offset (pr, 0)
 #ifdef PIC
 	bsrf	r1
 .LPCS0:
@@ -115,6 +122,10 @@ ENTRY(__makecontext)
 	jsr	@r1
 	 nop
 #endif
+        /* Restore to keep CFI/CFA balanced.  */
+	lds.l	@r15+, pr
+	cfi_adjust_cfa_offset (-4)
+	cfi_restore (pr)
 	/* If this returns (which can happen if the syscall fails) we'll exit
 	   the program with the return error value (-1).  */
 
@@ -143,7 +154,6 @@ ENTRY(__makecontext)
 .Lexit:
 	.long	HIDDEN_JUMPTARGET(exit)
 #endif
-	cfi_startproc
 PSEUDO_END(__makecontext)
 
 weak_alias (__makecontext, makecontext)