summary refs log tree commit diff
path: root/ports
diff options
context:
space:
mode:
authorWill Newton <will.newton@linaro.org>2013-08-29 20:10:26 +0100
committerWill Newton <will.newton@linaro.org>2013-08-30 10:50:25 +0100
commit6b06ac56cdfc9293908724e51e827534e97819aa (patch)
tree6b826b8afcd2477624425895af76b24da9d1cd10 /ports
parent2601bc1860c33653f2d402b871f1211d460aa350 (diff)
downloadglibc-6b06ac56cdfc9293908724e51e827534e97819aa.tar.gz
glibc-6b06ac56cdfc9293908724e51e827534e97819aa.tar.xz
glibc-6b06ac56cdfc9293908724e51e827534e97819aa.zip
ARM: Fix clone code when built for Thumb.
The mov lr, pc instruction will lose the Thumb bit from the return address
so use blx lr instead.

ports/ChangeLog.arm:

2013-08-30  Will Newton  <will.newton@linaro.org>

	[BZ #15909]
	* sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use blx
	instead of mov lr, pc.
Diffstat (limited to 'ports')
-rw-r--r--ports/ChangeLog.arm6
-rw-r--r--ports/sysdeps/unix/sysv/linux/arm/clone.S4
2 files changed, 8 insertions, 2 deletions
diff --git a/ports/ChangeLog.arm b/ports/ChangeLog.arm
index 8236f0f7d7..2a95834ce7 100644
--- a/ports/ChangeLog.arm
+++ b/ports/ChangeLog.arm
@@ -1,5 +1,11 @@
 2013-08-30  Will Newton  <will.newton@linaro.org>
 
+	[BZ #15909]
+	* sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use blx
+	instead of mov lr, pc.
+
+2013-08-30  Will Newton  <will.newton@linaro.org>
+
 	* sysdeps/arm/armv6t2/strlen.S: New file.
 
 2013-08-29  Thomas Schwinge  <thomas@codesourcery.com>
diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
index ce9c2a5ba1..6e74fa702b 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/clone.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/clone.S
@@ -93,8 +93,8 @@ PSEUDO_END (__clone)
 	mov	lr, pc
 	bx      ip
 #else
-	mov	lr, pc
-	ldr 	pc, [sp], #8
+	ldr 	lr, [sp], #8
+	blx	lr
 #endif
 
 	@ and we are done, passing the return value through r0