summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/sparc
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2011-04-04 12:42:39 +0000
committerguenther <guenther@openbsd.org>2011-04-04 12:42:39 +0000
commit9372e0f08d36e465dbbf8ed7d81cada3fa4b57ab (patch)
tree8d94440db80d44dadc263ef20aa74460d6eae930 /lib/libc/arch/sparc
parentBetter. (diff)
downloadwireguard-openbsd-9372e0f08d36e465dbbf8ed7d81cada3fa4b57ab.tar.xz
wireguard-openbsd-9372e0f08d36e465dbbf8ed7d81cada3fa4b57ab.zip
Move __cerror to ___cerror with a weak alias so that rthreads can override it.
On mips64, also correct the name called from plain cerror to __cerror. "looks correct" miod@
Diffstat (limited to 'lib/libc/arch/sparc')
-rw-r--r--lib/libc/arch/sparc/sys/cerror.S13
1 files changed, 6 insertions, 7 deletions
diff --git a/lib/libc/arch/sparc/sys/cerror.S b/lib/libc/arch/sparc/sys/cerror.S
index fef245ce195..613b2bf953e 100644
--- a/lib/libc/arch/sparc/sys/cerror.S
+++ b/lib/libc/arch/sparc/sys/cerror.S
@@ -1,4 +1,4 @@
-/* $OpenBSD: cerror.S,v 1.5 2005/08/07 16:40:15 espie Exp $ */
+/* $OpenBSD: cerror.S,v 1.6 2011/04/04 12:42:39 guenther Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -36,18 +36,17 @@
#include "SYS.h"
.globl _C_LABEL(errno)
+
+WEAK_ALIAS(__cerror, ___cerror)
+
+FUNC(_C_LABEL(___cerror))
#ifdef PIC
-FUNC(_C_LABEL(__cerror))
ld [%g1 + _C_LABEL(errno)], %g1
st %o0, [%g1]
- mov -1, %o0
- retl
- mov -1, %o1
#else
-FUNC(_C_LABEL(__cerror))
sethi %hi(_C_LABEL(errno)), %g1
st %o0, [%g1 + %lo(_C_LABEL(errno))]
+#endif
mov -1, %o0
retl
mov -1, %o1
-#endif