This is the mail archive of the libc-ports@sources.redhat.com mailing list for the libc-ports project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH 2/2 roland/arm-sfi-macros] ARM: sfi_sp assembler macro


Another requirement of the arm-nacl ABI is that all explicit modifications
of sp take a special form.  By "explicit" I mean not including push/pop or
any [sp...]! forms of loads or stores (or sp! forms of ldm/stm).  I haven't
yet dealt with the dynamic linker support code, and other than that longjmp
is the only place that actually does any such sp modification.

See the previous message for pointers to the non-no-op definition of sfi_sp
that will be used by the arm-nacl configuration.


Thanks,
Roland


ports/ChangeLog.arm
	* sysdeps/arm/sysdep.h [!ARM_SFI_MACROS] (sfi_sp): New macro.
	* sysdeps/arm/__longjmp.S: Use it.

--- a/ports/sysdeps/arm/__longjmp.S
+++ b/ports/sysdeps/arm/__longjmp.S
@@ -36,7 +36,7 @@ ENTRY (__longjmp)
 	cfi_undefined (r4)
 	CHECK_SP (r4)
 #endif
-	sfi_breg ip, \
+	sfi_sp sfi_breg ip, \
 	ldmia	\B!, JMP_BUF_REGLIST
 	cfi_restore (v1)
 	cfi_restore (v2)
--- a/ports/sysdeps/arm/sysdep.h
+++ b/ports/sysdeps/arm/sysdep.h
@@ -250,6 +250,11 @@
 		pld [\basereg, \offset]
 	.endm
 
+/* This macro precedes any instruction that directly changes the SP.
+   It's not needed for push/pop or for any kind of load or store that
+   implicitly changes the SP via the ! syntax.  */
+# define sfi_sp	/* Nothing to do.  */
+
 # endif
 
 #endif	/* __ASSEMBLER__ */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]