16-bit external branches in libc/sysdeps/linux/m68k/clone.S
Richard Sandiford
richard at codesourcery.com
Fri Jun 2 14:33:16 UTC 2006
Until a few months ago, libc/sysdeps/linux/m68k/clone.S defined
__syscall_error itself. This local definition was removed in
revision 13305:
http://www.uclibc.org/cgi-bin/viewcvs.cgi/trunk/uClibc/libc/sysdeps/linux/m68k/clone.S?rev=13305&view=log
specifically:
--- trunk/uClibc/libc/sysdeps/linux/m68k/clone.S 2006/01/14 00:58:03 13277
+++ trunk/uClibc/libc/sysdeps/linux/m68k/clone.S 2006/01/14 06:42:52 13305
@@ -55,17 +55,6 @@
rts
-__syscall_error:
- negl %d0
- movel %d0, %sp at -
- lea __errno_location-.-8, %a0
- jsr %pc@(%a0)
- movel %d0, %a0
- movel %sp at +, %a0@
- moveq #-1, %d0
-
- rts
-
thread_start:
/*subl %fp, %fp*/ /* terminate the stack frame */
jsr (%a0)
However, the clone code uses bcc.w to branch to __syscall_error.
This made sense when there was a local definition, because the
label was guaranteed to be in range. We can't guarantee that
the external definition will be in range though; it depends on
the order that the objects are linked.
This patch adjusts clone.S to use jbcc instead. Please install if OK.
Richard
Index: libc/sysdeps/linux/m68k/clone.S
===================================================================
--- libc/sysdeps/linux/m68k/clone.S (revision 15264)
+++ libc/sysdeps/linux/m68k/clone.S (working copy)
@@ -21,11 +21,11 @@ clone:
movel 4(%sp), %d1 /* no NULL function pointers */
movel %d1, %a0
tstl %d1
- beq.w __syscall_error
+ jbeq __syscall_error
movel 8(%sp), %d1 /* no NULL stack pointers */
movel %d1, %a1
tstl %d1
- beq.w __syscall_error
+ jbeq __syscall_error
/* Allocate space and copy the argument onto the new stack. */
movel 16(%sp), -(%a1)
@@ -50,7 +50,7 @@ clone:
#endif
tstl %d0
- bmi.w __syscall_error
+ jbmi __syscall_error
beq.w thread_start
rts
More information about the uClibc
mailing list