summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authordrahn <drahn@openbsd.org>2004-02-10 16:46:30 +0000
committerdrahn <drahn@openbsd.org>2004-02-10 16:46:30 +0000
commit35e579dee4cceb722c2ae3e1fe238696c98d7836 (patch)
tree7ddc380ecc69917b4dafd8bdf037cb48b63d967c /lib
parentmake Nm match Dt; (diff)
downloadwireguard-openbsd-35e579dee4cceb722c2ae3e1fe238696c98d7836.tar.xz
wireguard-openbsd-35e579dee4cceb722c2ae3e1fe238696c98d7836.zip
Fix PIC cerror. ok miod@ mickey@
Diffstat (limited to 'lib')
-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 */