about summary refs log tree commit diff
path: root/sysdeps/sh
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/sh
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/sh')
-rw-r--r--sysdeps/sh/____longjmp_chk.S17
1 files changed, 15 insertions, 2 deletions
diff --git a/sysdeps/sh/____longjmp_chk.S b/sysdeps/sh/____longjmp_chk.S
index e8d5f687e1..b37a94861c 100644
--- a/sysdeps/sh/____longjmp_chk.S
+++ b/sysdeps/sh/____longjmp_chk.S
@@ -28,9 +28,16 @@ longjmp_msg:
 # define CALL_FAIL \
 	mov.l	.Lfail, r1;				\
 	mov.l	.Lstr, r4;				\
+	mov.l	r12, @-r15;				\
+	cfi_remember_state;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (r12, 0);			\
 	mova	.Lgot, r0;				\
 	mov.l	.Lgot, r12;				\
 	add	r0, r12;				\
+	sts.l	pr, @-r15;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
 	bsrf	r1;					\
 	 add	r12, r4;				\
 	/* Unreachable.	 */				\
@@ -41,11 +48,16 @@ longjmp_msg:
 .Lstr:							\
 	.long	longjmp_msg@GOTOFF;			\
 .Lfail:							\
-	.long	__GI___fortify_fail@PLT-(.Lfail0-.);
+	.long	__GI___fortify_fail@PLT-(.Lfail0-.);	\
+	cfi_restore_state;
 #else
 # define CALL_FAIL \
 	mov.l	.Lfail, r1;				\
 	mov.l	.Lstr, r4;				\
+	sts.l	pr, @-r15;				\
+	cfi_remember_state;				\
+	cfi_adjust_cfa_offset (4);			\
+	cfi_rel_offset (pr, 0);				\
 	jsr	@r1;					\
 	 nop;						\
 	/* Unreachable.	 */				\
@@ -53,7 +65,8 @@ longjmp_msg:
 .Lstr:							\
 	.long	longjmp_msg;				\
 .Lfail:							\
-	.long	__fortify_fail;
+	.long	__fortify_fail;				\
+	cfi_restore_state;
 #endif
 
 #define CHECK_SP(reg) \