summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/mips/syscall.S
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2007-09-15 07:25:54 +0000
committerMike Frysinger <vapier@gentoo.org>2007-09-15 07:25:54 +0000
commit62ac74d3f2b957bc91f91a03d93fa523e9a80c9f (patch)
tree2dda3ce3401084a9deece4cb3a048efc547f2310 /libc/sysdeps/linux/mips/syscall.S
parent59868cafe27e9d5a68f81bff4cda9aca5afaa3f7 (diff)
Atsushi Nemoto writes:
In MIPS syscall(2), .cpload was added to an the error path, but it was not enough for ABIs other then O32. Use SETUP_GP, SETUP_GP64 and RESTORE_GP64 to handle all ABIs. This patch fixes an error path of MIPS pipe(2) too.
Diffstat (limited to 'libc/sysdeps/linux/mips/syscall.S')
-rw-r--r--libc/sysdeps/linux/mips/syscall.S6
1 files changed, 5 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/mips/syscall.S b/libc/sysdeps/linux/mips/syscall.S
index 683529596..ff6f3d1b4 100644
--- a/libc/sysdeps/linux/mips/syscall.S
+++ b/libc/sysdeps/linux/mips/syscall.S
@@ -29,8 +29,10 @@
.type syscall,@function
.ent syscall
syscall:
+#ifdef __PIC__
+ SETUP_GP
+#endif
.set noreorder
- .cpload t9;
move v0, a0 /* Load system call number from first arg. */
move a0, a1 /* Move the next three args up a register. */
move a1, a2
@@ -68,7 +70,9 @@ syscall:
move a0,v0 /* Pass return val to C function. */
#ifdef __PIC__
+ SETUP_GP64(v0, syscall)
PTR_LA t9, __syscall_error
+ RESTORE_GP64
jr t9
#else
j __syscall_error