summaryrefslogtreecommitdiffstats
path: root/lib/libc/arch/sparc
diff options
context:
space:
mode:
authordrahn <drahn@openbsd.org>2002-11-23 19:04:39 +0000
committerdrahn <drahn@openbsd.org>2002-11-23 19:04:39 +0000
commitea3b52face73b757a3657b44037cf6b42f9e86b7 (patch)
tree20741ad79edf797de44dd4a9a00d385cfdc06027 /lib/libc/arch/sparc
parentbye bye (diff)
downloadwireguard-openbsd-ea3b52face73b757a3657b44037cf6b42f9e86b7.tar.xz
wireguard-openbsd-ea3b52face73b757a3657b44037cf6b42f9e86b7.zip
Make the mul/div/rem (and u... versions) weak so that ld.so can override
it with optimized versions. And allow ld.so to compile with strong versions with extra symbols so it can find them.
Diffstat (limited to 'lib/libc/arch/sparc')
-rw-r--r--lib/libc/arch/sparc/gen/divrem.m47
-rw-r--r--lib/libc/arch/sparc/gen/mul.S7
-rw-r--r--lib/libc/arch/sparc/gen/umul.S7
3 files changed, 18 insertions, 3 deletions
diff --git a/lib/libc/arch/sparc/gen/divrem.m4 b/lib/libc/arch/sparc/gen/divrem.m4
index 9d50b98b98a..7bdab66b0f0 100644
--- a/lib/libc/arch/sparc/gen/divrem.m4
+++ b/lib/libc/arch/sparc/gen/divrem.m4
@@ -1,4 +1,4 @@
-/* $OpenBSD: divrem.m4,v 1.2 2000/03/01 17:31:23 todd Exp $ */
+/* $OpenBSD: divrem.m4,v 1.3 2002/11/23 19:04:39 drahn Exp $ */
/*
* Copyright (c) 1992, 1993
* The Regents of the University of California. All rights reserved.
@@ -131,6 +131,11 @@ L.$1.eval(TWOSUPN+$2):
#include "DEFS.h"
#include <machine/trap.h>
+#ifndef STRONG_SPARC
+.weak NAME
+#else
+FUNC(patsubst(NAME,\.,__))
+#endif
FUNC(NAME)
ifelse(S, `true',
` ! compute sign of result; if neither is negative, no problem
diff --git a/lib/libc/arch/sparc/gen/mul.S b/lib/libc/arch/sparc/gen/mul.S
index df05d2ec65e..8873e83cfec 100644
--- a/lib/libc/arch/sparc/gen/mul.S
+++ b/lib/libc/arch/sparc/gen/mul.S
@@ -37,7 +37,7 @@
#if defined(LIBC_SCCS)
.text
- .asciz "$OpenBSD: mul.S,v 1.2 1996/08/19 08:17:42 tholo Exp $"
+ .asciz "$OpenBSD: mul.S,v 1.3 2002/11/23 19:04:39 drahn Exp $"
#endif /* LIBC_SCCS */
/*
@@ -51,6 +51,11 @@
*/
#include "DEFS.h"
+#ifndef STRONG_SPARC
+.weak .mul
+#else
+FUNC(__mul)
+#endif
FUNC(.mul)
mov %o0, %y ! multiplier -> Y
andncc %o0, 0xfff, %g0 ! test bits 12..31
diff --git a/lib/libc/arch/sparc/gen/umul.S b/lib/libc/arch/sparc/gen/umul.S
index c8de0dd3180..fa848993325 100644
--- a/lib/libc/arch/sparc/gen/umul.S
+++ b/lib/libc/arch/sparc/gen/umul.S
@@ -37,7 +37,7 @@
#if defined(LIBC_SCCS)
.text
- .asciz "$OpenBSD: umul.S,v 1.2 1996/08/19 08:17:46 tholo Exp $"
+ .asciz "$OpenBSD: umul.S,v 1.3 2002/11/23 19:04:39 drahn Exp $"
#endif /* LIBC_SCCS */
/*
@@ -57,6 +57,11 @@
*/
#include "DEFS.h"
+#ifndef STRONG_SPARC
+.weak .umul
+#else
+FUNC(__umul)
+#endif
FUNC(.umul)
or %o0, %o1, %o4
mov %o0, %y ! multiplier -> Y