summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDale Rahn <drahn@cvs.openbsd.org>2002-11-23 19:04:40 +0000
committerDale Rahn <drahn@cvs.openbsd.org>2002-11-23 19:04:40 +0000
commit12cf65b51948f6cc478b917b1180e442ef309ffe (patch)
tree5314bb902c2a682b9dc9eb0581241c678b4657ad
parent60fb65fee92a3d20313b09fa86ada46fcb518df3 (diff)
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.
-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