aboutsummaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux/sh/syscall_error.S
diff options
context:
space:
mode:
Diffstat (limited to 'libc/sysdeps/linux/sh/syscall_error.S')
-rw-r--r--libc/sysdeps/linux/sh/syscall_error.S18
1 files changed, 17 insertions, 1 deletions
diff --git a/libc/sysdeps/linux/sh/syscall_error.S b/libc/sysdeps/linux/sh/syscall_error.S
index 1764ebfc8..07f1cfb63 100644
--- a/libc/sysdeps/linux/sh/syscall_error.S
+++ b/libc/sysdeps/linux/sh/syscall_error.S
@@ -1,6 +1,19 @@
.align 4
__syscall_error:
/* Call errno_location, store '-r4' in errno and return -1 */
+#ifdef __SH_FDPIC__
+ neg r4, r4
+ sts.l pr, @-r15
+ mov.l r4, @-r15
+ mov.l 1f, r0
+ mov.l @(r0,r12), r0
+ mov.l @(0,r0), r1
+ jsr @r1
+ mov.l @(4,r0), r12
+ mov.l @r15+, r4
+ lds.l @r15+, pr
+ mov.l r4, @r0
+#else
mov.l r12, @-r15
sts.l pr, @-r15
#ifdef __HAVE_SHARED__
@@ -20,6 +33,7 @@ __syscall_error:
mov.l r12, @r0
lds.l @r15+, pr
mov.l @r15+,r12
+#endif
/* And just kick back a -1. */
rts
@@ -27,7 +41,9 @@ __syscall_error:
.align 4
-#ifdef __HAVE_SHARED__
+#ifdef __SH_FDPIC__
+1: .long __errno_location@GOTFUNCDESC
+#elif defined __HAVE_SHARED__
1: .long __errno_location@GOT
.LG: .long _GLOBAL_OFFSET_TABLE_
#else