diff mbox

[roland/arm-setjmp] ARM: Fix up setjmp/longjmp changes sfi_* macro use.

Message ID 20140311183803.DA2B974475@topped-with-meat.com
State Committed
Headers show

Commit Message

Roland McGrath March 11, 2014, 6:38 p.m. UTC
The recent changes to ARM's setjmp/longjmp ignored the sfi_* macros (which
is fine enough, I don't mind doing the fix-up).  So this fixes them again.

Thanks,
Roland


2014-03-11  Roland McGrath  <roland@hack.frob.com>

	* sysdeps/arm/setjmp.S: Use sfi_breg on stores of mangled registers.
	* sysdeps/arm/__longjmp.S: Use sfi_breg on loads of mangled registers.
	Move sfi_sp use from the load-multiple (that no longer sets sp) to
	the new mov targetting sp.

Comments

Joseph Myers March 11, 2014, 6:42 p.m. UTC | #1
On Tue, 11 Mar 2014, Roland McGrath wrote:

> 2014-03-11  Roland McGrath  <roland@hack.frob.com>
> 
> 	* sysdeps/arm/setjmp.S: Use sfi_breg on stores of mangled registers.
> 	* sysdeps/arm/__longjmp.S: Use sfi_breg on loads of mangled registers.
> 	Move sfi_sp use from the load-multiple (that no longer sets sp) to
> 	the new mov targetting sp.

OK, presuming no changes to the generated code for ARM Linux.
Roland McGrath March 11, 2014, 7:16 p.m. UTC | #2
> On Tue, 11 Mar 2014, Roland McGrath wrote:
> 
> > 2014-03-11  Roland McGrath  <roland@hack.frob.com>
> > 
> > 	* sysdeps/arm/setjmp.S: Use sfi_breg on stores of mangled registers.
> > 	* sysdeps/arm/__longjmp.S: Use sfi_breg on loads of mangled registers.
> > 	Move sfi_sp use from the load-multiple (that no longer sets sp) to
> > 	the new mov targetting sp.
> 
> OK, presuming no changes to the generated code for ARM Linux.

Right.  I forgot to mention that I did indeed verify arm-linux-gnueabihf
got no code changes.

Committed.


Thanks,
Roland
diff mbox

Patch

--- a/sysdeps/arm/__longjmp.S
+++ b/sysdeps/arm/__longjmp.S
@@ -38,22 +38,27 @@  ENTRY (__longjmp)
 #endif
 
 #ifdef PTR_DEMANGLE
-	ldr	a4, [ip], #4
+	sfi_breg ip, \
+	ldr	a4, [\B], #4
 	PTR_DEMANGLE (a4, a4, a3, r4)
 	cfi_undefined (r4)
-	ldr	r4, [ip], #4
+	sfi_breg ip, \
+	ldr	r4, [\B], #4
 	PTR_DEMANGLE2 (r4, r4, a3)
 #else
-	ldr	a4, [ip], #4
-	ldr	r4, [ip], #4
+	sfi_breg ip, \
+	ldr	a4, [\B], #4
+	sfi_breg ip, \
+	ldr	r4, [\B], #4
 	cfi_undefined (r4)
 #endif
 	/* longjmp probe expects longjmp first argument (4@r0), second
 	   argument (-4@r1), and target address (4@r4), respectively.  */
 	LIBC_PROBE (longjmp, 3, 4@r0, -4@r1, 4@r4)
+	sfi_sp \
 	mov	sp, a4
 	mov	lr, r4
-	sfi_sp sfi_breg ip, \
+	sfi_breg ip, \
 	ldmia	\B!, JMP_BUF_REGLIST
 	cfi_restore (v1)
 	cfi_restore (v2)
--- a/sysdeps/arm/setjmp.S
+++ b/sysdeps/arm/setjmp.S
@@ -36,12 +36,16 @@  ENTRY (__sigsetjmp)
 #ifdef PTR_MANGLE
 	mov	a4, sp
 	PTR_MANGLE2 (a4, a4, a3)
-	str	a4, [ip], #4
+	sfi_breg ip, \
+	str	a4, [\B], #4
 	PTR_MANGLE2 (a4, lr, a3)
-	str	a4, [ip], #4
+	sfi_breg ip, \
+	str	a4, [\B], #4
 #else
-	str	sp, [ip], #4
-	str	lr, [ip], #4
+	sfi_breg ip, \
+	str	sp, [\B], #4
+	sfi_breg ip, \
+	str	lr, [\B], #4
 #endif
 	/* Save registers */
 	sfi_breg ip, \