Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(771)

Unified Diff: lss/linux_syscall_support.h

Issue 8165010: Make clone() compatible with ARM's Thumb-2 instruction set. Bug reported and (Closed) Base URL: http://linux-syscall-support.googlecode.com/svn/trunk/
Patch Set: Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lss/linux_syscall_support.h
===================================================================
--- lss/linux_syscall_support.h (revision 6)
+++ lss/linux_syscall_support.h (working copy)
@@ -2170,8 +2170,24 @@
/* In the child, now. Call "fn(arg)".
*/
"ldr r0,[sp, #4]\n"
+
+ /* When compiling for Thumb-2 the "MOV LR,PC" here
+ * won't work because it loads PC+4 into LR,
+ * whereas the LDR is a 4-byte instruction.
+ * This results in the child thread always
+ * crashing with an "Illegal Instruction" when it
+ * returned into the middle of the LDR instruction
+ * The instruction sequence used instead was
+ * recommended by
+ * "https://wiki.edubuntu.org/ARM/Thumb2PortingHowto#Quick_Reference".
+ */
+ #ifdef __thumb2__
+ "ldr r7,[sp]\n"
+ "blx r7\n"
+ #else
"mov lr,pc\n"
"ldr pc,[sp]\n"
+ #endif
/* Call _exit(%r0).
*/
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698