aboutsummaryrefslogtreecommitdiffstats
path: root/ns-debug
blob: 1f98cdfbb1aa2410a31f4fa4c46c09f5efe694cd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
---
 arch/x86/Makefile |    2 +-
 kernel/module.c   |   11 +++++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -65,7 +65,7 @@ else
 
         # -funit-at-a-time shrinks the kernel .text considerably
         # unfortunately it makes reading oopses harder.
-        KBUILD_CFLAGS += $(call cc-option,-funit-at-a-time)
+        KBUILD_CFLAGS += $(call cc-option,-fno-unit-at-a-time)
 
         # this works around some issues with generating unwind tables in older gccs
         # newer gccs do it by default
--- a/kernel/module.c
+++ b/kernel/module.c
@@ -47,7 +47,7 @@
 #include <linux/license.h>
 #include <asm/sections.h>
 
-#if 0
+#if 1
 #define DEBUGP printk
 #else
 #define DEBUGP(fmt , a...)
@@ -160,9 +160,16 @@ static const struct kernel_symbol *looku
 	const struct kernel_symbol *stop)
 {
 	const struct kernel_symbol *ks = start;
-	for (; ks < stop; ks++)
+	for (; ks < stop; ks++) {
+		if (ks->name == NULL) {
+			printk("%ld name NULL (prev %s %lx %s)\n",
+				(unsigned long)ks-(unsigned long)start,
+				ks[-1].name, ks[-1].value, ks[-1].namespace);
+			return NULL;
+		}
 		if (strcmp(ks->name, name) == 0)
 			return ks;
+	}
 	return NULL;
 }