KALLSYMS_V2 and KMOD_V2 both used bit 0x2000 of kt->flags. On a kernel
built without CONFIG_MODULES there is no "modules" or "module_list"
symbol, but KALLSYMS_V2 is still set. module_init() then took the
KMOD_V2 path, tried to resolve "modules" and aborted the session:
WARNING: cannot determine how modules are linked
crash: cannot resolve: "modules"
Give KALLSYMS_V2 its own bit. With that, a CONFIG_MODULES=n dumpfile
reports "no kernel module access" and the rest of the session works
normally.
Signed-off-by: Dave Young <yangrr.2009(a)tsinghua.org.cn>
---
defs.h | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/defs.h b/defs.h
index d05b3f34e2f4..157077a10064 100644
--- a/defs.h
+++ b/defs.h
@@ -656,7 +656,12 @@ struct new_utsname {
#define GCC_3_3_2 (0x800)
#define KMOD_V1 (0x1000)
#define KMOD_V2 (0x2000)
-#define KALLSYMS_V2 (0x2000)
+/*
+ * KALLSYMS_V2 must not share a bit with KMOD_V2: on a kernel built
+ * without CONFIG_MODULES there is no "modules" symbol, but KALLSYMS_V2
+ * is still set and module_init() would mistake it for module support.
+ */
+#define KALLSYMS_V2 (0x80000000)
#define TVEC_BASES_V2 (0x4000)
#define GCC_3_3_3 (0x8000)
#define USE_OLD_BT (0x10000)
--
2.51.1