summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2004-02-10 16:46:31 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2004-02-10 16:46:31 +0000
commitc6026ffae6db9e07c5fc7170d4ef9115420febe4 (patch)
treed9191e7532126b31f8abf230250f7bbe3b011d7d
parenta2bbf36c10b6e2c9ed2787e047e5bc56713d2abd (diff)
Fix PIC cerror. ok miod@ mickey@
-rw-r--r--lib/libc/arch/amd64/sys/cerror.S5
-rw-r--r--lib/libc/arch/x86_64/sys/cerror.S5
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/libc/arch/amd64/sys/cerror.S b/lib/libc/arch/amd64/sys/cerror.S
index 400bb5d81e0..f45b3b09cf2 100644
--- a/lib/libc/arch/amd64/sys/cerror.S
+++ b/lib/libc/arch/amd64/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.1 2004/01/28 01:44:45 mickey Exp $ */
+/* $OpenBSD: cerror.S,v 1.2 2004/02/10 16:46:30 drahn Exp $ */
/* $NetBSD: cerror.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $ */
/*-
@@ -47,7 +47,8 @@
_ENTRY(CERROR)
#ifdef PIC
- movq %rax, PIC_GOT(_C_LABEL(errno))
+ movq PIC_GOT(_C_LABEL(errno)), %rcx
+ movq %rax, (%rcx)
#else
movq %rax, _C_LABEL(errno)(%rip)
#endif /* PIC */
diff --git a/lib/libc/arch/x86_64/sys/cerror.S b/lib/libc/arch/x86_64/sys/cerror.S
index 400bb5d81e0..f45b3b09cf2 100644
--- a/lib/libc/arch/x86_64/sys/cerror.S
+++ b/lib/libc/arch/x86_64/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.1 2004/01/28 01:44:45 mickey Exp $ */
+/* $OpenBSD: cerror.S,v 1.2 2004/02/10 16:46:30 drahn Exp $ */
/* $NetBSD: cerror.S,v 1.2 2002/06/03 18:30:33 fvdl Exp $ */
/*-
@@ -47,7 +47,8 @@
_ENTRY(CERROR)
#ifdef PIC
- movq %rax, PIC_GOT(_C_LABEL(errno))
+ movq PIC_GOT(_C_LABEL(errno)), %rcx
+ movq %rax, (%rcx)
#else
movq %rax, _C_LABEL(errno)(%rip)
#endif /* PIC */