From: Will Newton <will.newton@linaro.org>
To: libc-ports@sourceware.org
Cc: patches@linaro.org
Subject: [PATCH] ARM: Fix clone code when built for Thumb.
Date: Thu, 29 Aug 2013 19:17:00 -0000 [thread overview]
Message-ID: <521F9E4E.5040906@linaro.org> (raw)
The mov lr, pc instruction will lose the Thumb bit from the return address
so use blx lr instead.
ports/ChangeLog.arm:
2013-08-29 Will Newton <will.newton@linaro.org>
* sysdeps/unix/sysv/linux/arm/clone.S (__clone): Use blx
instead of mov lr, pc.
---
ports/sysdeps/unix/sysv/linux/arm/clone.S | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/ports/sysdeps/unix/sysv/linux/arm/clone.S b/ports/sysdeps/unix/sysv/linux/arm/clone.S
index ce9c2a5..6e74fa7 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
--
1.8.1.4
next reply other threads:[~2013-08-29 19:17 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-29 19:17 Will Newton [this message]
2013-08-29 19:26 ` Joseph S. Myers
2013-08-29 20:19 ` Will Newton
2013-08-29 20:56 ` Add willnewton to glibc group Joseph S. Myers
2013-08-30 10:18 ` [PATCH] ARM: Fix clone code when built for Thumb Will Newton
2013-08-30 17:35 ` Carlos O'Donell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=521F9E4E.5040906@linaro.org \
--to=will.newton@linaro.org \
--cc=libc-ports@sourceware.org \
--cc=patches@linaro.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).