summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libc/sysdeps/linux/mips/pipe.S6
-rw-r--r--libc/sysdeps/linux/mips/syscall.S6
2 files changed, 11 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/mips/pipe.S b/libc/sysdeps/linux/mips/pipe.S
index dd1aed1b2..8b3023679 100644
--- a/libc/sysdeps/linux/mips/pipe.S
+++ b/libc/sysdeps/linux/mips/pipe.S
@@ -14,7 +14,11 @@
.globl pipe
.ent pipe, 0
+ .type pipe,@function
pipe:
+#ifdef __PIC__
+ SETUP_GP
+#endif
li v0,__NR_pipe
syscall
bnez a3, 1f
@@ -28,7 +32,9 @@ pipe:
/* uClibc change -- stop */
#ifdef __PIC__
+ SETUP_GP64(v0, pipe)
PTR_LA t9, __syscall_error
+ RESTORE_GP64
jr t9
#else
j __syscall_error
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