summaryrefslogtreecommitdiffstats
path: root/sys/lib/libkern/mcount.c
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>1996-06-18 10:10:48 +0000
committerderaadt <deraadt@openbsd.org>1996-06-18 10:10:48 +0000
commit2b029e3574f4cf0ed158ce5ea51768049634734c (patch)
treef0e2e48cdcffbba2352c4aab638e64e7088dabdd /sys/lib/libkern/mcount.c
parentfrom netbsd; Fix PR/2504: return with no args returns 0 instead of (diff)
downloadwireguard-openbsd-2b029e3574f4cf0ed158ce5ea51768049634734c.tar.xz
wireguard-openbsd-2b029e3574f4cf0ed158ce5ea51768049634734c.zip
sync to libc
Diffstat (limited to 'sys/lib/libkern/mcount.c')
-rw-r--r--sys/lib/libkern/mcount.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/sys/lib/libkern/mcount.c b/sys/lib/libkern/mcount.c
index f0aee538c3b..acdde38523d 100644
--- a/sys/lib/libkern/mcount.c
+++ b/sys/lib/libkern/mcount.c
@@ -1,4 +1,4 @@
-/* $NetBSD: mcount.c,v 1.3 1995/03/28 20:01:02 jtc Exp $ */
+/* $NetBSD: mcount.c,v 1.3.6.1 1996/06/12 04:23:01 cgd Exp $ */
/*-
* Copyright (c) 1983, 1992, 1993
@@ -34,7 +34,11 @@
*/
#if !defined(lint) && !defined(_KERNEL) && defined(LIBC_SCCS)
+#if 0
static char sccsid[] = "@(#)mcount.c 8.1 (Berkeley) 6/4/93";
+#else
+static char rcsid[] = "$NetBSD: mcount.c,v 1.3.6.1 1996/06/12 04:23:01 cgd Exp $";
+#endif
#endif
#include <sys/param.h>
@@ -87,7 +91,14 @@ _MCOUNT_DECL(frompc, selfpc) /* _mcount; may be static, inline, etc */
if (frompc > p->textsize)
goto done;
- frompcindex = &p->froms[frompc / (p->hashfraction * sizeof(*p->froms))];
+#if (HASHFRACTION & (HASHFRACTION - 1)) == 0
+ if (p->hashfraction == HASHFRACTION)
+ frompcindex =
+ &p->froms[frompc / (HASHFRACTION * sizeof(*p->froms))];
+ else
+#endif
+ frompcindex =
+ &p->froms[frompc / (p->hashfraction * sizeof(*p->froms))];
toindex = *frompcindex;
if (toindex == 0) {
/*