about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRichard Henderson <rth@twiddle.net>2013-02-14 22:15:55 -0800
committerRichard Henderson <rth@twiddle.net>2013-03-06 07:46:47 -0800
commitd137b6dc52efbb0a55baba8e8851e930cc781217 (patch)
treeb4d970800dded1501bcbc6738983caa670943bcf
parent46dede0c00285bb43890ed68c0b8572e855b54e2 (diff)
downloadglibc-d137b6dc52efbb0a55baba8e8851e930cc781217.tar.gz
glibc-d137b6dc52efbb0a55baba8e8851e930cc781217.tar.xz
glibc-d137b6dc52efbb0a55baba8e8851e930cc781217.zip
arm: Unless arm4t, pop return address directly into pc
-rw-r--r--ports/ChangeLog.arm4
-rw-r--r--ports/sysdeps/arm/arm-mcount.S6
-rw-r--r--ports/sysdeps/arm/dl-tlsdesc.S9
3 files changed, 14 insertions, 5 deletions
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 7acde01568..400a7db517 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,5 +1,9 @@
 2013-03-06  Richard Henderson <rth@redhat.com>
 
+	* sysdeps/arm/arm-mcount.S (_mcount): Use pop into pc unless
+	__ARM_ARCH_4T__ and __THUMB_INTERWORK__.
+	* sysdeps/arm/dl-tlsdesc.S (_dl_tlsdesc_dynamic): Likewise.
+
 	* sysdeps/arm/sysdep.h (BX, BXC, BLX): New macros.
 	(DO_RET): Use BX.
 	(RETINSTR): Use BXC.
diff --git a/ports/sysdeps/arm/arm-mcount.S b/ports/sysdeps/arm/arm-mcount.S
index b6e5ec78a1..8ad077925b 100644
--- a/ports/sysdeps/arm/arm-mcount.S
+++ b/ports/sysdeps/arm/arm-mcount.S
@@ -82,9 +82,7 @@ ENTRY(_mcount)
 	ldrne r0, [r0, #-4]
 	movsne r1, lr
 	blne __mcount_internal
-#ifdef __thumb2__
-	pop	{r0, r1, r2, r3, fp, pc}
-#else
+#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
 	pop	{r0, r1, r2, r3, fp, lr}
 	cfi_adjust_cfa_offset (-24)
 	cfi_restore (r0)
@@ -94,6 +92,8 @@ ENTRY(_mcount)
 	cfi_restore (fp)
 	cfi_restore (lr)
 	bx lr
+#else
+	pop	{r0, r1, r2, r3, fp, pc}
 #endif
 END(_mcount)
 
diff --git a/ports/sysdeps/arm/dl-tlsdesc.S b/ports/sysdeps/arm/dl-tlsdesc.S
index 62a7e438c1..e810d0db37 100644
--- a/ports/sysdeps/arm/dl-tlsdesc.S
+++ b/ports/sysdeps/arm/dl-tlsdesc.S
@@ -109,13 +109,18 @@ _dl_tlsdesc_dynamic:
 1:	mov	r0, r1
 	bl	__tls_get_addr
 	rsb	r0, r4, r0
-2:	pop	{r2,r3,r4, lr}
+2:
+#if defined (__ARM_ARCH_4T__) && defined (__THUMB_INTERWORK__)
+	pop	{r2,r3,r4, lr}
 	cfi_adjust_cfa_offset (-16)
 	cfi_restore (lr)
 	cfi_restore (r4)
 	cfi_restore (r3)
 	cfi_restore (r2)
-	BX      (lr)
+	bx	lr
+#else
+	pop	{r2,r3,r4, pc}
+#endif
 	.fnend
 	cfi_endproc
 	.size	_dl_tlsdesc_dynamic, .-_dl_tlsdesc_dynamic