public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] ARM: Allow building __longjmp as Thumb.
@ 2013-10-03 10:38 Will Newton
  2013-10-03 16:33 ` Joseph S. Myers
  0 siblings, 1 reply; 3+ messages in thread
From: Will Newton @ 2013-10-03 10:38 UTC (permalink / raw)
  To: libc-ports; +Cc: patches


Convert __longjmp code to allow building as Thumb.

ports/ChangeLog.arm:

2013-09-25  Will Newton  <will.newton@linaro.org>

	* sysdeps/arm/__longjmp.S (NO_THUMB): Remove define.
	(__longjmp): Use Thumb supported instructions.
	* sysdeps/unix/sysv/linux/arm/____longjmp_chk.S (NO_THUMB):
	Remove define.
---
 ports/sysdeps/arm/__longjmp.S                       | 6 +++---
 ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S | 2 --
 2 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/ports/sysdeps/arm/__longjmp.S b/ports/sysdeps/arm/__longjmp.S
index 2b1f7f4..894c121 100644
--- a/ports/sysdeps/arm/__longjmp.S
+++ b/ports/sysdeps/arm/__longjmp.S
@@ -16,8 +16,6 @@
    License along with the GNU C Library.  If not, see
    <http://www.gnu.org/licenses/>.  */

-/* ??? Needs more rearrangement for the LDM to handle thumb mode.  */
-#define NO_THUMB
 #include <sysdep.h>
 #include <bits/setjmp.h>
 #include <rtld-global-offsets.h>
@@ -28,6 +26,7 @@
 ENTRY (__longjmp)
 	mov	ip, r0
 	movs	r0, r1		/* get the return value in place */
+	it	eq
 	moveq	r0, #1		/* can't let setjmp() return zero! */

 #ifdef CHECK_SP
@@ -44,7 +43,8 @@ ENTRY (__longjmp)
 #ifdef PTR_DEMANGLE
 	PTR_DEMANGLE (fp, a4, a3, a2)
 	ldr	a4, [ip], #4
-	PTR_DEMANGLE2 (sp, a4, a3)
+	PTR_DEMANGLE2 (a4, a4, a3)
+	mov	sp, a4
 	ldr	a4, [ip], #4
 	PTR_DEMANGLE2 (lr, a4, a3)
 #else
diff --git a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
index 6ee7a1a..6777ef6 100644
--- a/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
+++ b/ports/sysdeps/unix/sysv/linux/arm/____longjmp_chk.S
@@ -15,8 +15,6 @@
    License along with the GNU C Library.  If not, see
    <http://www.gnu.org/licenses/>.  */

-/* ??? Needs more rearrangement for the LDM to handle thumb mode.  */
-#define NO_THUMB
 #include <sysdep.h>

 	.section .rodata.str1.1,"aMS",%progbits,1
-- 
1.8.1.4

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-10-04  9:56 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-03 10:38 [PATCH] ARM: Allow building __longjmp as Thumb Will Newton
2013-10-03 16:33 ` Joseph S. Myers
2013-10-04  9:56   ` Will Newton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).