Module Name: src
Committed By: rin
Date: Tue Mar 10 08:15:44 UTC 2020
Modified Files:
src/common/lib/libc/arch/m68k/string: ffs.S
Log Message:
For kernel, rename ffs to __ffssi2 rather than having a weak symbol.
This enables us to load modules depended to __ffssi2.
It is difficult to deal with weak symbols consistently in in-kernel
linker. See explanation by pgoyette on tech-kern:
http://mail-index.netbsd.org/tech-kern/2020/03/09/msg026148.html
Also, we do not currently provide ffs(9) as a kernel routine.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/common/lib/libc/arch/m68k/string/ffs.S
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/common/lib/libc/arch/m68k/string/ffs.S
diff -u src/common/lib/libc/arch/m68k/string/ffs.S:1.7 src/common/lib/libc/arch/m68k/string/ffs.S:1.8
--- src/common/lib/libc/arch/m68k/string/ffs.S:1.7 Mon Mar 9 13:36:10 2020
+++ src/common/lib/libc/arch/m68k/string/ffs.S Tue Mar 10 08:15:44 2020
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs.S,v 1.7 2020/03/09 13:36:10 rin Exp $ */
+/* $NetBSD: ffs.S,v 1.8 2020/03/10 08:15:44 rin Exp $ */
/*-
* Copyright (c) 1990 The Regents of the University of California.
@@ -39,13 +39,22 @@
#if 0
RCSID("from: @(#)ffs.s 5.1 (Berkeley) 5/12/90")
#else
- RCSID("$NetBSD: ffs.S,v 1.7 2020/03/09 13:36:10 rin Exp $")
+ RCSID("$NetBSD: ffs.S,v 1.8 2020/03/10 08:15:44 rin Exp $")
#endif
#endif /* LIBC_SCCS and not lint */
/* bit = ffs(value) */
+#ifdef _LIBC
WEAK_ALIAS(__ffssi2,ffs)
+#else /* KERNEL */
+/*
+ * Our in-kernel linker does not understand weak references, which
+ * prevents modules depended on __ffssi2 from being loaded. Also,
+ * we do not provide ffs(9) as a kernel routine. Let's rename it!
+ */
+#define ffs __ffssi2
+#endif
#if (!defined(__mc68010__) && !defined(__mcoldfire__)) || defined(__mcfisac__)