about summary refs log tree commit diff
path: root/ports
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-02-14 21:00:14 -0800
committerRichard Henderson <rth@twiddle.net>2013-03-06 07:46:45 -0800
commit55668624cf2c1c70ff67d8160f021df1f50fab0e (patch)
tree8c8090e169aa1eb36f4dd3ab11f65d0a0790a5d4 /ports
parent5ff5dfe748c0585bb43e9d16fea9d89dc3bf2b9b (diff)
downloadglibc-55668624cf2c1c70ff67d8160f021df1f50fab0e.tar.gz
glibc-55668624cf2c1c70ff67d8160f021df1f50fab0e.tar.xz
glibc-55668624cf2c1c70ff67d8160f021df1f50fab0e.zip
arm: Use push/pop mnemonics
For arm this makes no difference--the result is bit-for-bit identical;
for thumb this results in smaller encodings.  Perhaps it ought not and
this is in fact an assembler bug, but I also think it's clearer.
Diffstat (limited to 'ports')
-rw-r--r--ports/ChangeLog.arm21
-rw-r--r--ports/sysdeps/arm/arm-mcount.S6
-rw-r--r--ports/sysdeps/arm/crti.S4
-rw-r--r--ports/sysdeps/arm/crtn.S8
-rw-r--r--ports/sysdeps/arm/dl-tlsdesc.S16
-rw-r--r--ports/sysdeps/arm/dl-trampoline.S4
-rw-r--r--ports/sysdeps/arm/memcpy.S58
-rw-r--r--ports/sysdeps/arm/memmove.S58
-rw-r--r--ports/sysdeps/arm/start.S10
-rw-r--r--ports/sysdeps/arm/sysdep.h6
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/clone.S4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/mmap.S8
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/mmap64.S8
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h32
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/syscall.S4
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/sysdep.h27
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/vfork.S2
20 files changed, 154 insertions, 134 deletions
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 6458a75154..8279a3e0de 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,5 +1,26 @@
 2013-03-06  Richard Henderson <rth@redhat.com>
 
+	* sysdeps/arm/arm-mcount.S (_mcount): Use push/pop mnemonics.
+	* sysdeps/arm/crti.S, sysdeps/arm/crtn.S: Likewise.
+	* sysdeps/arm/dl-tlsdesc.S: Likewise.
+	* sysdeps/arm/dl-trampoline.S: Likewise.
+	* sysdeps/arm/start.S: Likewise.
+	* sysdeps/arm/memcpy.S (PULL): Rename macro from pull.
+	(PUSH): Rename macro from push.
+	(memcpy): Use push/pop mnemonics.
+	* sysdeps/arm/memmove.S: Similarly.
+	* sysdeps/arm/sysdep.h (CALL_MCOUNT): Use push/pop mnemonics.
+	* sysdeps/unix/sysv/linux/arm/____longjmp_chk.S: Likewise.
+	* sysdeps/unix/sysv/linux/arm/clone.S: Likewise.
+	* sysdeps/unix/sysv/linux/arm/mmap.S: Likewise.
+	* sysdeps/unix/sysv/linux/arm/mmap64.S: Likewise.
+	* sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h: Likewise.
+	* sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c: Likewise.
+	* sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c: Likewise.
+	* sysdeps/unix/sysv/linux/arm/syscall.S: Likewise.
+	* sysdeps/unix/sysv/linux/arm/sysdep.h: Likewise.
+	* sysdeps/unix/sysv/linux/arm/vfork.S: Likewise.
+
 	* sysdeps/arm/sysdep.h [__ASSEMBLER__]: Enable thumb2 if __thumb2__.
 	(PC_OFS): Respect __thumb__ if __ASSEMBLER__.
 
diff --git a/ports/sysdeps/arm/arm-mcount.S b/ports/sysdeps/arm/arm-mcount.S
index 679d042ba4..b6e5ec78a1 100644
--- a/ports/sysdeps/arm/arm-mcount.S
+++ b/ports/sysdeps/arm/arm-mcount.S
@@ -69,7 +69,7 @@ END(__gnu_mcount_nc)
    code be compiled with APCS frame pointers.  */
 
 ENTRY(_mcount)
-	stmdb sp!, {r0, r1, r2, r3, fp, lr}
+	push	{r0, r1, r2, r3, fp, lr}
 	cfi_adjust_cfa_offset (24)
 	cfi_rel_offset (r0, 0)
 	cfi_rel_offset (r1, 4)
@@ -83,9 +83,9 @@ ENTRY(_mcount)
 	movsne r1, lr
 	blne __mcount_internal
 #ifdef __thumb2__
-	ldmia sp!, {r0, r1, r2, r3, fp, pc}
+	pop	{r0, r1, r2, r3, fp, pc}
 #else
-	ldmia sp!, {r0, r1, r2, r3, fp, lr}
+	pop	{r0, r1, r2, r3, fp, lr}
 	cfi_adjust_cfa_offset (-24)
 	cfi_restore (r0)
 	cfi_restore (r1)
diff --git a/ports/sysdeps/arm/crti.S b/ports/sysdeps/arm/crti.S
index 1d55ae27ad..be20a11995 100644
--- a/ports/sysdeps/arm/crti.S
+++ b/ports/sysdeps/arm/crti.S
@@ -80,7 +80,7 @@ call_weak_fn:
 	.globl _init
 	.type _init, %function
 _init:
-	stmfd sp!, {r3, lr}
+	push	{r3, lr}
 #if PREINIT_FUNCTION_WEAK
 	bl call_weak_fn
 #else
@@ -92,4 +92,4 @@ _init:
 	.globl _fini
 	.type _fini, %function
 _fini:
-	stmfd sp!, {r3, lr}
+	push	{r3, lr}
diff --git a/ports/sysdeps/arm/crtn.S b/ports/sysdeps/arm/crtn.S
index a01eb01397..ae7546c5e7 100644
--- a/ports/sysdeps/arm/crtn.S
+++ b/ports/sysdeps/arm/crtn.S
@@ -42,16 +42,16 @@
 
 	.section .init,"ax",%progbits
 #ifdef __ARM_ARCH_4T__
-	ldmfd sp!, {r3, lr}
+	pop {r3, lr}
 	bx lr
 #else
-	ldmfd sp!, {r3, pc}
+	pop {r3, pc}
 #endif
 
 	.section .fini,"ax",%progbits
 #ifdef __ARM_ARCH_4T__
-	ldmfd sp!, {r3, lr}
+	pop {r3, lr}
 	bx lr
 #else
-	ldmfd sp!, {r3, pc}
+	pop {r3, pc}
 #endif
diff --git a/ports/sysdeps/arm/dl-tlsdesc.S b/ports/sysdeps/arm/dl-tlsdesc.S
index 1a15272821..718d5fd178 100644
--- a/ports/sysdeps/arm/dl-tlsdesc.S
+++ b/ports/sysdeps/arm/dl-tlsdesc.S
@@ -90,7 +90,7 @@ _dl_tlsdesc_dynamic:
 	/* Our calling convention is to clobber r0, r1 and the processor
 	   flags.  All others that are modified must be saved */
 	.save	{r2,r3,r4,lr}
-	stmdb   sp!, {r2,r3,r4,lr}
+	push	{r2,r3,r4,lr}
 	cfi_adjust_cfa_offset (16)
 	cfi_rel_offset (r2,0)
 	cfi_rel_offset (r3,4)
@@ -115,7 +115,7 @@ _dl_tlsdesc_dynamic:
 1:	mov	r0, r1
 	bl	__tls_get_addr
 	rsb	r0, r4, r0
-2:	ldmia	sp!, {r2,r3,r4, lr}
+2:	pop	{r2,r3,r4, lr}
 	cfi_adjust_cfa_offset (-16)
 	cfi_restore (lr)
 	cfi_restore (r4)
@@ -146,7 +146,7 @@ _dl_tlsdesc_lazy_resolver:
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (r2, 0)
 	.save	{r0,r1,r3,ip,lr}
-	stmdb	sp!, {r0, r1, r3, ip, lr}
+	push	{r0, r1, r3, ip, lr}
 	cfi_adjust_cfa_offset (20)
 	cfi_rel_offset (r0, 0)
 	cfi_rel_offset (r1, 4)
@@ -154,14 +154,14 @@ _dl_tlsdesc_lazy_resolver:
 	cfi_rel_offset (ip, 12)
 	cfi_rel_offset (lr, 16)
 	bl	_dl_tlsdesc_lazy_resolver_fixup
-	ldmia	sp!, {r0, r1, r3, ip, lr}
+	pop	{r0, r1, r3, ip, lr}
 	cfi_adjust_cfa_offset (-20)
 	cfi_restore (lr)
 	cfi_restore (ip)
 	cfi_restore (r3)
 	cfi_restore (r1)
 	cfi_restore (r0)
-	ldmia	sp!, {r2}
+	pop	{r2}
 	cfi_adjust_cfa_offset (-4)
 	cfi_restore (r2)
 	ldr	r1, [r0, #4]
@@ -184,7 +184,7 @@ _dl_tlsdesc_resolve_hold:
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (r2, 0)
 	.save	{r0,r1,r3,ip,lr}
-	stmdb   sp!, {r0, r1, r3, ip, lr}
+	push	{r0, r1, r3, ip, lr}
 	cfi_adjust_cfa_offset (20)
 	cfi_rel_offset (r0, 0)
 	cfi_rel_offset (r1, 4)
@@ -193,14 +193,14 @@ _dl_tlsdesc_resolve_hold:
 	cfi_rel_offset (lr, 16)
 	adr	r2, _dl_tlsdesc_resolve_hold
 	bl	_dl_tlsdesc_resolve_hold_fixup
-	ldmia   sp!, {r0, r1, r3, ip, lr}
+	pop	{r0, r1, r3, ip, lr}
 	cfi_adjust_cfa_offset (-20)
 	cfi_restore (lr)
 	cfi_restore (ip)
 	cfi_restore (r3)
 	cfi_restore (r1)
 	cfi_restore (r0)
-	ldmia   sp!, {r2}
+	pop	{r2}
 	cfi_adjust_cfa_offset (-4)
 	cfi_restore (r2)
 	ldr     r1, [r0, #4]
diff --git a/ports/sysdeps/arm/dl-trampoline.S b/ports/sysdeps/arm/dl-trampoline.S
index 561d8ae6fd..f2d1679a64 100644
--- a/ports/sysdeps/arm/dl-trampoline.S
+++ b/ports/sysdeps/arm/dl-trampoline.S
@@ -43,7 +43,7 @@ _dl_runtime_resolve:
 	@	lr points to &GOT[2]
 
 	@ Save arguments.  We save r4 to realign the stack.
-	stmdb	sp!,{r0-r4}
+	push	{r0-r4}
 	cfi_adjust_cfa_offset (20)
 	cfi_rel_offset (r0, 0)
 	cfi_rel_offset (r1, 4)
@@ -67,7 +67,7 @@ _dl_runtime_resolve:
 
 	@ get arguments and return address back.  We restore r4
 	@ only to realign the stack.
-	ldmia	sp!, {r0-r4,lr}
+	pop	{r0-r4,lr}
 	cfi_adjust_cfa_offset (-24)
 
 	@ jump to the newly found address
diff --git a/ports/sysdeps/arm/memcpy.S b/ports/sysdeps/arm/memcpy.S
index 98b9b47e39..98981ef489 100644
--- a/ports/sysdeps/arm/memcpy.S
+++ b/ports/sysdeps/arm/memcpy.S
@@ -45,11 +45,11 @@
  * Endian independent macros for shifting bytes within registers.
  */
 #ifndef __ARMEB__
-#define pull            lsr
-#define push            lsl
+#define PULL            lsr
+#define PUSH            lsl
 #else
-#define pull            lsl
-#define push            lsr
+#define PULL            lsl
+#define PUSH            lsr
 #endif
 
 		.text
@@ -58,7 +58,7 @@
 
 ENTRY(memcpy)
 
-		stmfd	sp!, {r0, r4, lr}
+		push	{r0, r4, lr}
 		cfi_adjust_cfa_offset (12)
 		cfi_rel_offset (r4, 4)
 		cfi_rel_offset (lr, 8)
@@ -74,7 +74,7 @@ ENTRY(memcpy)
 		bne	10f
 
 1:		subs	r2, r2, #(28)
-		stmfd	sp!, {r5 - r8}
+		push	{r5 - r8}
 		cfi_adjust_cfa_offset (16)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
@@ -131,7 +131,7 @@ ENTRY(memcpy)
 
 	CALGN(	bcs	2b			)
 
-7:		ldmfd	sp!, {r5 - r8}
+7:		pop	{r5 - r8}
 		cfi_adjust_cfa_offset (-16)
 		cfi_restore (r5)
 		cfi_restore (r6)
@@ -147,13 +147,13 @@ ENTRY(memcpy)
 		strcsb	ip, [r0]
 
 #if defined (__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
-		ldmfd	sp!, {r0, r4, lr}
+		pop	{r0, r4, lr}
 		cfi_adjust_cfa_offset (-12)
 		cfi_restore (r4)
 		cfi_restore (lr)
 		bx      lr
 #else
-		ldmfd	sp!, {r0, r4, pc}
+		pop	{r0, r4, pc}
 #endif
 
 		cfi_restore_state
@@ -189,7 +189,7 @@ ENTRY(memcpy)
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
-11:		stmfd	sp!, {r5 - r9}
+11:		push	{r5 - r9}
 		cfi_adjust_cfa_offset (20)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
@@ -206,30 +206,30 @@ ENTRY(memcpy)
 
 12:	PLD(	pld	[r1, #124]		)
 13:		ldmia	r1!, {r4, r5, r6, r7}
-		mov	r3, lr, pull #\pull
+		mov	r3, lr, PULL #\pull
 		subs	r2, r2, #32
 		ldmia	r1!, {r8, r9, ip, lr}
-		orr	r3, r3, r4, push #\push
-		mov	r4, r4, pull #\pull
-		orr	r4, r4, r5, push #\push
-		mov	r5, r5, pull #\pull
-		orr	r5, r5, r6, push #\push
-		mov	r6, r6, pull #\pull
-		orr	r6, r6, r7, push #\push
-		mov	r7, r7, pull #\pull
-		orr	r7, r7, r8, push #\push
-		mov	r8, r8, pull #\pull
-		orr	r8, r8, r9, push #\push
-		mov	r9, r9, pull #\pull
-		orr	r9, r9, ip, push #\push
-		mov	ip, ip, pull #\pull
-		orr	ip, ip, lr, push #\push
+		orr	r3, r3, r4, PUSH #\push
+		mov	r4, r4, PULL #\pull
+		orr	r4, r4, r5, PUSH #\push
+		mov	r5, r5, PULL #\pull
+		orr	r5, r5, r6, PUSH #\push
+		mov	r6, r6, PULL #\pull
+		orr	r6, r6, r7, PUSH #\push
+		mov	r7, r7, PULL #\pull
+		orr	r7, r7, r8, PUSH #\push
+		mov	r8, r8, PULL #\pull
+		orr	r8, r8, r9, PUSH #\push
+		mov	r9, r9, PULL #\pull
+		orr	r9, r9, ip, PUSH #\push
+		mov	ip, ip, PULL #\pull
+		orr	ip, ip, lr, PUSH #\push
 		stmia	r0!, {r3, r4, r5, r6, r7, r8, r9, ip}
 		bge	12b
 	PLD(	cmn	r2, #96			)
 	PLD(	bge	13b			)
 
-		ldmfd	sp!, {r5 - r9}
+		pop	{r5 - r9}
 		cfi_adjust_cfa_offset (-20)
 		cfi_restore (r5)
 		cfi_restore (r6)
@@ -240,10 +240,10 @@ ENTRY(memcpy)
 14:		ands	ip, r2, #28
 		beq	16f
 
-15:		mov	r3, lr, pull #\pull
+15:		mov	r3, lr, PULL #\pull
 		ldr	lr, [r1], #4
 		subs	ip, ip, #4
-		orr	r3, r3, lr, push #\push
+		orr	r3, r3, lr, PUSH #\push
 		str	r3, [r0], #4
 		bgt	15b
 	CALGN(	cmp	r2, #0			)
diff --git a/ports/sysdeps/arm/memmove.S b/ports/sysdeps/arm/memmove.S
index 059ca7ac31..d9fa0e3b6b 100644
--- a/ports/sysdeps/arm/memmove.S
+++ b/ports/sysdeps/arm/memmove.S
@@ -45,11 +45,11 @@
  * Endian independent macros for shifting bytes within registers.
  */
 #ifndef __ARMEB__
-#define pull            lsr
-#define push            lsl
+#define PULL            lsr
+#define PUSH            lsl
 #else
-#define pull            lsl
-#define push            lsr
+#define PULL            lsl
+#define PUSH            lsr
 #endif
 
 		.text
@@ -73,7 +73,7 @@ ENTRY(memmove)
 		bls	HIDDEN_JUMPTARGET(memcpy)
 #endif
 
-		stmfd	sp!, {r0, r4, lr}
+		push	{r0, r4, lr}
 		cfi_adjust_cfa_offset (12)
 		cfi_rel_offset (r4, 4)
 		cfi_rel_offset (lr, 8)
@@ -91,7 +91,7 @@ ENTRY(memmove)
 		bne	10f
 
 1:		subs	r2, r2, #(28)
-		stmfd	sp!, {r5 - r8}
+		push	{r5 - r8}
 		cfi_adjust_cfa_offset (16)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
@@ -147,7 +147,7 @@ ENTRY(memmove)
 
 	CALGN(	bcs	2b			)
 
-7:		ldmfd	sp!, {r5 - r8}
+7:		pop	{r5 - r8}
 		cfi_adjust_cfa_offset (-16)
 		cfi_restore (r5)
 		cfi_restore (r6)
@@ -163,13 +163,13 @@ ENTRY(memmove)
 		strcsb	ip, [r0, #-1]
 
 #if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
-		ldmfd	sp!, {r0, r4, lr}
+		pop	{r0, r4, lr}
 		cfi_adjust_cfa_offset (-12)
 		cfi_restore (r4)
 		cfi_restore (lr)
 		bx      lr
 #else
-		ldmfd	sp!, {r0, r4, pc}
+		pop	{r0, r4, pc}
 #endif
 
 		cfi_restore_state
@@ -204,7 +204,7 @@ ENTRY(memmove)
 	CALGN(	subcc	r2, r2, ip		)
 	CALGN(	bcc	15f			)
 
-11:		stmfd	sp!, {r5 - r9}
+11:		push	{r5 - r9}
 		cfi_adjust_cfa_offset (20)
 		cfi_rel_offset (r5, 0)
 		cfi_rel_offset (r6, 4)
@@ -221,30 +221,30 @@ ENTRY(memmove)
 
 12:	PLD(	pld	[r1, #-128]		)
 13:		ldmdb   r1!, {r7, r8, r9, ip}
-		mov     lr, r3, push #\push
+		mov     lr, r3, PUSH #\push
 		subs    r2, r2, #32
 		ldmdb   r1!, {r3, r4, r5, r6}
-		orr     lr, lr, ip, pull #\pull
-		mov     ip, ip, push #\push
-		orr     ip, ip, r9, pull #\pull
-		mov     r9, r9, push #\push
-		orr     r9, r9, r8, pull #\pull
-		mov     r8, r8, push #\push
-		orr     r8, r8, r7, pull #\pull
-		mov     r7, r7, push #\push
-		orr     r7, r7, r6, pull #\pull
-		mov     r6, r6, push #\push
-		orr     r6, r6, r5, pull #\pull
-		mov     r5, r5, push #\push
-		orr     r5, r5, r4, pull #\pull
-		mov     r4, r4, push #\push
-		orr     r4, r4, r3, pull #\pull
+		orr     lr, lr, ip, PULL #\pull
+		mov     ip, ip, PUSH #\push
+		orr     ip, ip, r9, PULL #\pull
+		mov     r9, r9, PUSH #\push
+		orr     r9, r9, r8, PULL #\pull
+		mov     r8, r8, PUSH #\push
+		orr     r8, r8, r7, PULL #\pull
+		mov     r7, r7, PUSH #\push
+		orr     r7, r7, r6, PULL #\pull
+		mov     r6, r6, PUSH #\push
+		orr     r6, r6, r5, PULL #\pull
+		mov     r5, r5, PUSH #\push
+		orr     r5, r5, r4, PULL #\pull
+		mov     r4, r4, PUSH #\push
+		orr     r4, r4, r3, PULL #\pull
 		stmdb   r0!, {r4 - r9, ip, lr}
 		bge	12b
 	PLD(	cmn	r2, #96			)
 	PLD(	bge	13b			)
 
-		ldmfd	sp!, {r5 - r9}
+		pop	{r5 - r9}
 		cfi_adjust_cfa_offset (-20)
 		cfi_restore (r5)
 		cfi_restore (r6)
@@ -255,10 +255,10 @@ ENTRY(memmove)
 14:		ands	ip, r2, #28
 		beq	16f
 
-15:		mov     lr, r3, push #\push
+15:		mov     lr, r3, PUSH #\push
 		ldr	r3, [r1, #-4]!
 		subs	ip, ip, #4
-		orr	lr, lr, r3, pull #\pull
+		orr	lr, lr, r3, PULL #\pull
 		str	lr, [r0, #-4]!
 		bgt	15b
 	CALGN(	cmp	r2, #0			)
diff --git a/ports/sysdeps/arm/start.S b/ports/sysdeps/arm/start.S
index a1d15b8104..0a57b0becb 100644
--- a/ports/sysdeps/arm/start.S
+++ b/ports/sysdeps/arm/start.S
@@ -80,14 +80,14 @@ _start:
 	mov lr, #0
 
 	/* Pop argc off the stack and save a pointer to argv */
-	ldr a2, [sp], #4
+	pop { a2 }
 	mov a3, sp
 
 	/* Push stack limit */
-	str a3, [sp, #-4]!
+	push { a3 }
 
 	/* Push rtld_fini */
-	str a1, [sp, #-4]!
+	push { a1 }
 
 #ifdef SHARED
 	ldr sl, .L_GOT
@@ -97,7 +97,7 @@ _start:
 	ldr ip, .L_GOT+4	/* __libc_csu_fini */
 	ldr ip, [sl, ip]
 
-	str ip, [sp, #-4]!	/* Push __libc_csu_fini */
+	push { ip }		/* Push __libc_csu_fini */
 
 	ldr a4, .L_GOT+8	/* __libc_csu_init */
 	ldr a4, [sl, a4]
@@ -113,7 +113,7 @@ _start:
 	ldr ip, =__libc_csu_fini
 
 	/* Push __libc_csu_fini */
-	str ip, [sp, #-4]!
+	push { ip }
 
 	/* Set up the other arguments in registers */
 	ldr a1, =main
diff --git a/ports/sysdeps/arm/sysdep.h b/ports/sysdeps/arm/sysdep.h
index d855ceb3c3..d74a32811a 100644
--- a/ports/sysdeps/arm/sysdep.h
+++ b/ports/sysdeps/arm/sysdep.h
@@ -80,7 +80,7 @@
 /* Call __gnu_mcount_nc if GCC >= 4.4.  */
 #if __GNUC_PREREQ(4,4)
 #define CALL_MCOUNT					\
-	str	lr,[sp, #-4]!;				\
+	push	{lr};					\
 	cfi_adjust_cfa_offset (4);			\
 	cfi_rel_offset (lr, 0);				\
 	bl	PLTJMP(mcount);				\
@@ -88,11 +88,11 @@
 	cfi_restore (lr)
 #else /* else call _mcount */
 #define CALL_MCOUNT					\
-	str	lr,[sp, #-4]!;				\
+	push	{lr};					\
 	cfi_adjust_cfa_offset (4);			\
 	cfi_rel_offset (lr, 0);				\
 	bl	PLTJMP(mcount);				\
-	ldr	lr, [sp], #4;				\
+	pops	{lr};					\
 	cfi_adjust_cfa_offset (-4);			\
 	cfi_restore (lr)
 #endif
diff --git a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
index 29edec69d2..6ee7a1aebd 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
@@ -53,7 +53,7 @@ longjmp_msg:
 	cfi_remember_state;			\
 	cmp	sp, reg;			\
 	bls	.Lok;				\
-	str	r7, [sp, #-4]!;			\
+	push	{ r7 };				\
 	cfi_adjust_cfa_offset (4);		\
 	cfi_rel_offset (r7, 0);			\
 	mov	r5, r0;				\
@@ -79,7 +79,7 @@ longjmp_msg:
 .Lfail:						\
 	add	sp, sp, #12;			\
 	cfi_adjust_cfa_offset (-12);		\
-	ldr	r7, [sp], #4;			\
+	pop	{ r7 };				\
 	cfi_adjust_cfa_offset (-4);		\
 	cfi_restore (r7);			\
 	CALL_FAIL				\
diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
index 9009393f33..ce9c2a5ba1 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S
@@ -49,7 +49,7 @@ ENTRY(__clone)
 	mov	ip, r2
 #endif
 	@ new sp is already in r1
-	stmfd	sp!, {r4, r7}
+	push	{r4, r7}
 	cfi_adjust_cfa_offset (8)
 	cfi_rel_offset (r4, 0)
 	cfi_rel_offset (r7, 4)
@@ -61,7 +61,7 @@ ENTRY(__clone)
 	cfi_endproc
 	cmp	r0, #0
 	beq	1f
-	ldmfd	sp!, {r4, r7}
+	pop	{r4, r7}
 	blt	PLTJMP(C_SYMBOL_NAME(__syscall_error))
 	RETINSTR(, lr)
 
diff --git a/ports/sysdeps/unix/sysv/linux/arm/mmap.S b/ports/sysdeps/unix/sysv/linux/arm/mmap.S
index 68560b065e..06b737eebe 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/mmap.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/mmap.S
@@ -23,11 +23,11 @@
 
 ENTRY (__mmap)
 	/* shuffle args */
-	str	r5, [sp, #-4]!
+	push	{ r5 }
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (r5, 0)
 	ldr	r5, [sp, #8]
-	str	r4, [sp, #-4]!
+	push	{ r4 }
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (r4, 0)
 	cfi_remember_state
@@ -43,10 +43,10 @@ ENTRY (__mmap)
 
 	/* restore registers */
 2:
-	ldr	r4, [sp], #4
+	pop	{ r4 }
 	cfi_adjust_cfa_offset (-4)
 	cfi_restore (r4)
-	ldr	r5, [sp], #4
+	pop	{ r5 }
 	cfi_adjust_cfa_offset (-4)
 	cfi_restore (r5)
 
diff --git a/ports/sysdeps/unix/sysv/linux/arm/mmap64.S b/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
index dcbab3aed6..d039129b29 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/mmap64.S
@@ -34,11 +34,11 @@
 	.text
 ENTRY (__mmap64)
 	ldr	ip, [sp, $LOW_OFFSET]
-	str	r5, [sp, #-4]!
+	push	{ r5 }
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (r5, 0)
 	ldr	r5, [sp, $HIGH_OFFSET]
-	str	r4, [sp, #-4]!
+	push	{ r4 }
 	cfi_adjust_cfa_offset (4)
 	cfi_rel_offset (r4, 0)
 	cfi_remember_state
@@ -51,7 +51,7 @@ ENTRY (__mmap64)
 	orr	r5, ip, r5, lsl $20	@ compose page offset
 	DO_CALL (mmap2, 0)
 	cmn	r0, $4096
-	ldmfd	sp!, {r4, r5}
+	pop	{r4, r5}
 	cfi_adjust_cfa_offset (-8)
 	cfi_restore (r4)
 	cfi_restore (r5)
@@ -62,7 +62,7 @@ ENTRY (__mmap64)
 	cfi_restore_state
 .Linval:
 	mov	r0, $-EINVAL
-	ldmfd	sp!, {r4, r5}
+	pop	{r4, r5}
 	cfi_adjust_cfa_offset (-8)
 	cfi_restore (r4)
 	cfi_restore (r5)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
index 2fc053523f..59b826ded4 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/sysdep-cancel.h
@@ -76,19 +76,19 @@
 
 # define DOCARGS_0				\
 	.save {r7};				\
-	str	lr, [sp, #-4]!;			\
+	push	{lr};				\
 	cfi_adjust_cfa_offset (4);		\
 	cfi_rel_offset (lr, 0);			\
 	.save	{lr}
 # define UNDOCARGS_0
 # define RESTORE_LR_0				\
-	ldr	lr, [sp], #4;			\
+	pop	{lr};				\
 	cfi_adjust_cfa_offset (-4);		\
 	cfi_restore (lr)
 
 # define DOCARGS_1				\
 	.save	{r7};				\
-	stmfd	sp!, {r0, r1, lr};		\
+	push	{r0, r1, lr};			\
 	cfi_adjust_cfa_offset (12);		\
 	cfi_rel_offset (lr, 8);			\
 	.save	{lr};				\
@@ -102,13 +102,13 @@
 
 # define DOCARGS_2				\
 	.save	{r7};				\
-	stmfd	sp!, {r0, r1, lr};		\
+	push	{r0, r1, lr};			\
 	cfi_adjust_cfa_offset (12);		\
 	cfi_rel_offset (lr, 8);			\
 	.save	{lr};				\
 	.pad	#8
 # define UNDOCARGS_2				\
-	ldmfd	sp!, {r0, r1};			\
+	pop	{r0, r1};			\
 	cfi_adjust_cfa_offset (-8);		\
 	RESTART_UNWIND
 # define RESTORE_LR_2				\
@@ -116,13 +116,13 @@
 
 # define DOCARGS_3				\
 	.save	{r7};				\
-	stmfd	sp!, {r0, r1, r2, r3, lr};	\
+	push	{r0, r1, r2, r3, lr};		\
 	cfi_adjust_cfa_offset (20);		\
 	cfi_rel_offset (lr, 16);		\
 	.save	{lr};				\
 	.pad	#16
 # define UNDOCARGS_3				\
-	ldmfd	sp!, {r0, r1, r2, r3};		\
+	pop	{r0, r1, r2, r3};		\
 	cfi_adjust_cfa_offset (-16);		\
 	RESTART_UNWIND
 # define RESTORE_LR_3				\
@@ -130,13 +130,13 @@
 
 # define DOCARGS_4				\
 	.save	{r7};				\
-	stmfd	sp!, {r0, r1, r2, r3, lr};	\
+	push	{r0, r1, r2, r3, lr};		\
 	cfi_adjust_cfa_offset (20);		\
 	cfi_rel_offset (lr, 16);		\
 	.save	{lr};				\
 	.pad	#16
 # define UNDOCARGS_4				\
-	ldmfd	sp!, {r0, r1, r2, r3};		\
+	pop	{r0, r1, r2, r3};		\
 	cfi_adjust_cfa_offset (-16);		\
 	RESTART_UNWIND
 # define RESTORE_LR_4				\
@@ -145,13 +145,13 @@
 /* r4 is only stmfd'ed for correct stack alignment.  */
 # define DOCARGS_5				\
 	.save	{r4, r7};			\
-	stmfd	sp!, {r0, r1, r2, r3, r4, lr};	\
+	push	{r0, r1, r2, r3, r4, lr};	\
 	cfi_adjust_cfa_offset (24);		\
 	cfi_rel_offset (lr, 20);		\
 	.save	{lr};				\
 	.pad	#20
 # define UNDOCARGS_5				\
-	ldmfd	sp!, {r0, r1, r2, r3};		\
+	pop	{r0, r1, r2, r3};		\
 	cfi_adjust_cfa_offset (-16);		\
 	.fnend;					\
 	.fnstart;				\
@@ -159,20 +159,20 @@
 	.save	{lr};				\
 	.pad	#4
 # define RESTORE_LR_5				\
-	ldmfd sp!, {r4, lr};			\
+	pop	{r4, lr};			\
 	cfi_adjust_cfa_offset (-8);		\
 	/* r4 will be marked as restored later.  */ \
 	cfi_restore (lr)
 
 # define DOCARGS_6				\
 	.save	{r4, r5, r7};			\
-	stmfd	sp!, {r0, r1, r2, r3, lr};	\
+	push	{r0, r1, r2, r3, lr};		\
 	cfi_adjust_cfa_offset (20);		\
 	cfi_rel_offset (lr, 16);		\
 	.save	{lr};				\
 	.pad	#16
 # define UNDOCARGS_6				\
-	ldmfd	sp!, {r0, r1, r2, r3};		\
+	pop	{r0, r1, r2, r3};		\
 	cfi_adjust_cfa_offset (-16);		\
 	.fnend;					\
 	.fnstart;				\
@@ -213,13 +213,13 @@ extern int __local_multiple_threads attribute_hidden;
 				   header.multiple_threads) == 0, 1)
 #  else
 #   define SINGLE_THREAD_P						\
-	stmfd	sp!, {r0, lr};						\
+	push	{r0, lr};						\
 	cfi_adjust_cfa_offset (8);					\
 	cfi_rel_offset (lr, 4);						\
 	GET_TLS (lr);							\
 	NEGOFF_ADJ_BASE (r0, MULTIPLE_THREADS_OFFSET);			\
 	ldr	ip, NEGOFF_OFF1 (r0, MULTIPLE_THREADS_OFFSET);		\
-	ldmfd	sp!, {r0, lr};						\
+	pop	{r0, lr};						\
 	cfi_adjust_cfa_offset (-8);					\
 	cfi_restore (lr);						\
 	teq	ip, #0
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
index caa6a26260..108924d8b3 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-forcedunwind.c
@@ -93,7 +93,7 @@ asm (
 "_Unwind_Resume:\n"
 "	.cfi_sections .debug_frame\n"
 "	" CFI_STARTPROC "\n"
-"	stmfd	sp!, {r4, r5, r6, lr}\n"
+"	push	{r4, r5, r6, lr}\n"
 "	" CFI_ADJUST_CFA_OFFSET (16)" \n"
 "	" CFI_REL_OFFSET (r4, 0) "\n"
 "	" CFI_REL_OFFSET (r5, 4) "\n"
@@ -108,7 +108,7 @@ asm (
 "	cmp	r3, #0\n"
 "	beq	4f\n"
 "5:	mov	r0, r6\n"
-"	ldmfd	sp!, {r4, r5, r6, lr}\n"
+"	pop	{r4, r5, r6, lr}\n"
 "	" CFI_ADJUST_CFA_OFFSET (-16) "\n"
 "	" CFI_RESTORE (r4) "\n"
 "	" CFI_RESTORE (r5) "\n"
diff --git a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
index 1211599131..d155ea7dc4 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
+++ b/ports/sysdeps/unix/sysv/linux/arm/nptl/unwind-resume.c
@@ -56,7 +56,7 @@ asm (
 "_Unwind_Resume:\n"
 "	.cfi_sections .debug_frame\n"
 "	" CFI_STARTPROC "\n"
-"	stmfd	sp!, {r4, r5, r6, lr}\n"
+"	push	{r4, r5, r6, lr}\n"
 "	" CFI_ADJUST_CFA_OFFSET (16)" \n"
 "	" CFI_REL_OFFSET (r4, 0) "\n"
 "	" CFI_REL_OFFSET (r5, 4) "\n"
@@ -71,7 +71,7 @@ asm (
 "	cmp	r3, #0\n"
 "	beq	4f\n"
 "5:	mov	r0, r6\n"
-"	ldmfd	sp!, {r4, r5, r6, lr}\n"
+"	pop	{r4, r5, r6, lr}\n"
 "	" CFI_ADJUST_CFA_OFFSET (-16) "\n"
 "	" CFI_RESTORE (r4) "\n"
 "	" CFI_RESTORE (r5) "\n"
diff --git a/ports/sysdeps/unix/sysv/linux/arm/syscall.S b/ports/sysdeps/unix/sysv/linux/arm/syscall.S
index 665ecb4de0..bdd5a52be8 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/syscall.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/syscall.S
@@ -23,7 +23,7 @@
 
 ENTRY (syscall)
 	mov	ip, sp
-	stmfd	sp!, {r4, r5, r6, r7}
+	push	{r4, r5, r6, r7}
 	cfi_adjust_cfa_offset (16)
 	cfi_rel_offset (r4, 0)
 	cfi_rel_offset (r5, 4)
@@ -35,7 +35,7 @@ ENTRY (syscall)
 	mov	r2, r3
 	ldmfd	ip, {r3, r4, r5, r6}
 	swi	0x0
-	ldmfd	sp!, {r4, r5, r6, r7}
+	pop	{r4, r5, r6, r7}
 	cfi_adjust_cfa_offset (-16)
 	cfi_restore (r4)
 	cfi_restore (r5)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
index dc2058b275..f2ab5f589f 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
+++ b/ports/sysdeps/unix/sysv/linux/arm/sysdep.h
@@ -147,23 +147,22 @@ __local_syscall_error:						\
 # else
 #  if defined(__ARM_ARCH_4T__) && defined(__THUMB_INTERWORK__)
 #   define POP_PC \
-  ldr lr, [sp], #4; \
+  pop { lr }; \
   cfi_adjust_cfa_offset (-4); \
   cfi_restore (lr); \
   bx lr
 #  else
-#   define POP_PC  \
-  ldr pc, [sp], #4
+#   define POP_PC  pop { pc }
 #  endif
 #  define SYSCALL_ERROR_HANDLER					\
 __local_syscall_error:						\
-	str	lr, [sp, #-4]!;					\
+	push	{ lr };						\
 	cfi_adjust_cfa_offset (4);				\
 	cfi_rel_offset (lr, 0);					\
-	str	r0, [sp, #-4]!;					\
+	push	{ r0 };	    					\
 	cfi_adjust_cfa_offset (4);				\
 	bl	PLTJMP(C_SYMBOL_NAME(__errno_location)); 	\
-	ldr	r1, [sp], #4;					\
+	pop	{ r1 };						\
 	cfi_adjust_cfa_offset (-4);				\
 	rsb	r1, r1, #0;					\
 	str	r1, [r0];					\
@@ -230,7 +229,7 @@ __local_syscall_error:						\
 #undef  DOARGS_0
 #define DOARGS_0					\
 	.fnstart;					\
-	str r7, [sp, #-4]!;				\
+	push	{ r7 };					\
 	cfi_adjust_cfa_offset (4);			\
 	cfi_rel_offset (r7, 0);				\
 	.save	{ r7 }
@@ -245,7 +244,7 @@ __local_syscall_error:						\
 #undef  DOARGS_5
 #define DOARGS_5					\
 	.fnstart;					\
-	stmfd	sp!, {r4, r7};				\
+	push	{r4, r7};				\
 	cfi_adjust_cfa_offset (8);			\
 	cfi_rel_offset (r4, 0);				\
 	cfi_rel_offset (r7, 4);				\
@@ -255,7 +254,7 @@ __local_syscall_error:						\
 #define DOARGS_6					\
 	.fnstart;					\
 	mov	ip, sp;					\
-	stmfd	sp!, {r4, r5, r7};			\
+	push	{r4, r5, r7};				\
 	cfi_adjust_cfa_offset (12);			\
 	cfi_rel_offset (r4, 0);				\
 	cfi_rel_offset (r5, 4);				\
@@ -266,7 +265,7 @@ __local_syscall_error:						\
 #define DOARGS_7					\
 	.fnstart;					\
 	mov	ip, sp;					\
-	stmfd	sp!, {r4, r5, r6, r7};			\
+	push	{r4, r5, r6, r7};			\
 	cfi_adjust_cfa_offset (16);			\
 	cfi_rel_offset (r4, 0);				\
 	cfi_rel_offset (r5, 4);				\
@@ -277,7 +276,7 @@ __local_syscall_error:						\
 
 #undef  UNDOARGS_0
 #define UNDOARGS_0					\
-	ldr	r7, [sp], #4;				\
+	pop	{r7};					\
 	cfi_adjust_cfa_offset (-4);			\
 	cfi_restore (r7);				\
 	.fnend
@@ -291,14 +290,14 @@ __local_syscall_error:						\
 #define UNDOARGS_4 UNDOARGS_0
 #undef  UNDOARGS_5
 #define UNDOARGS_5					\
-	ldmfd	sp!, {r4, r7};				\
+	pop	{r4, r7};				\
 	cfi_adjust_cfa_offset (-8);			\
 	cfi_restore (r4);				\
 	cfi_restore (r7);				\
 	.fnend
 #undef  UNDOARGS_6
 #define UNDOARGS_6					\
-	ldmfd	sp!, {r4, r5, r7};			\
+	pop	{r4, r5, r7};				\
 	cfi_adjust_cfa_offset (-12);			\
 	cfi_restore (r4);				\
 	cfi_restore (r5);				\
@@ -306,7 +305,7 @@ __local_syscall_error:						\
 	.fnend
 #undef  UNDOARGS_7
 #define UNDOARGS_7					\
-	ldmfd	sp!, {r4, r5, r6, r7};			\
+	pop	{r4, r5, r6, r7};			\
 	cfi_adjust_cfa_offset (-16);			\
 	cfi_restore (r4);				\
 	cfi_restore (r5);				\
diff --git a/ports/sysdeps/unix/sysv/linux/arm/vfork.S b/ports/sysdeps/unix/sysv/linux/arm/vfork.S
index ae931f79c6..128a6402b9 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/vfork.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/vfork.S
@@ -37,7 +37,7 @@ ENTRY (__vfork)
 	mov	ip, r7
 	cfi_register (r7, ip)
 	.fnstart
-	str r7, [sp, #-4]!
+	push	{ r7 }
 	cfi_adjust_cfa_offset (4)
 	.save { r7 }
 	ldr	r7, =SYS_ify (vfork)