aboutsummaryrefslogtreecommitdiff
path: root/sysdeps/unix/mips/sysdep.S
diff options
context:
space:
mode:
Diffstat (limited to 'sysdeps/unix/mips/sysdep.S')
-rw-r--r--sysdeps/unix/mips/sysdep.S25
1 files changed, 21 insertions, 4 deletions
diff --git a/sysdeps/unix/mips/sysdep.S b/sysdeps/unix/mips/sysdep.S
index 0cfc302770..ac8335fe5b 100644
--- a/sysdeps/unix/mips/sysdep.S
+++ b/sysdeps/unix/mips/sysdep.S
@@ -21,10 +21,23 @@
#define _ERRNO_H
#include <bits/errno.h>
-/* .globl errno */
-.set noreorder
+ .comm errno, 4
+#ifdef __ELF__
+ .type errno, @object
+#endif
+
+ .set noreorder
-ENTRY(syscall_error)
+ENTRY(__syscall_error)
+#ifdef __PIC__
+ .set noat
+ move $1, $31
+ bltzal $0, 0f
+ nop
+0: .cpload $31
+ move $31, $1
+ .set at
+#endif
#if defined (EWOULDBLOCK_sys) && EWOULDBLOCK_sys != EAGAIN
/* We translate the system's EWOULDBLOCK error into EAGAIN.
The GNU C library always defines EWOULDBLOCK==EAGAIN.
@@ -40,4 +53,8 @@ skip:
/* And just kick back a -1. */
j ra
li v0, -1
- .end syscall_error
+ END(__syscall_error)
+
+/* We provide this alias for compatilility with other Unices
+ like IRIX 5 */
+weak_alias (__syscall_error, syscall_error)