Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-10]: src/sys/kern Pull up following revision(s) (requested by ria...



details:   https://anonhg.NetBSD.org/src/rev/e705c09b5090
branches:  netbsd-10
changeset: 373625:e705c09b5090
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Feb 22 19:07:09 2023 +0000

description:
Pull up following revision(s) (requested by riastradh in ticket #100):

        sys/kern/kern_module.c: revision 1.161

module(9): Make error message for multiple MODULE decls more obvious.

diffstat:

 sys/kern/kern_module.c |  16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diffs (37 lines):

diff -r 4446f1eb489c -r e705c09b5090 sys/kern/kern_module.c
--- a/sys/kern/kern_module.c    Wed Feb 22 18:52:45 2023 +0000
+++ b/sys/kern/kern_module.c    Wed Feb 22 19:07:09 2023 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: kern_module.c,v 1.160 2022/10/26 23:22:07 riastradh Exp $      */
+/*     $NetBSD: kern_module.c,v 1.160.2.1 2023/02/22 19:07:09 martin Exp $     */
 
 /*-
  * Copyright (c) 2008 The NetBSD Foundation, Inc.
@@ -34,7 +34,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.160 2022/10/26 23:22:07 riastradh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: kern_module.c,v 1.160.2.1 2023/02/22 19:07:09 martin Exp $");
 
 #define _MODULE_INTERNAL
 
@@ -1632,8 +1632,16 @@
                return error;
        }
        if (size != sizeof(modinfo_t **)) {
-               module_error("`link_set_modules' section wrong size "
-                   "(got %zu, wanted %zu)", size, sizeof(modinfo_t **));
+               if (size > sizeof(modinfo_t **) &&
+                   (size % sizeof(modinfo_t **)) == 0) {
+                       module_error("`link_set_modules' section wrong size "
+                           "(%zu different MODULE declarations?)",
+                           size / sizeof(modinfo_t **));
+               } else {
+                       module_error("`link_set_modules' section wrong size "
+                           "(got %zu, wanted %zu)",
+                           size, sizeof(modinfo_t **));
+               }
                return ENOEXEC;
        }
        mod->mod_info = *(modinfo_t **)addr;



Home | Main Index | Thread Index | Old Index