Skip to contentSkip to conversation

Include useful absolute symbols in kallsyms

PATCH In review Keith Owens 2 participants 2 messages Oct 29, 2004 – Oct 30, 2004

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Include useful absolute symbols in kallsyms

Some absolute symbols are useful, they can even appear in back traces. Tweak kallsyms to retain the useful absolute symbols.

---

This list is from ia64, add absolute symbols from other architectures as required.

scripts/kallsyms.c +8 -1
Index: linux/scripts/kallsyms.c
===================================================================
@@ -121,7 +121,14 @@ read_symbol(FILE *in, struct sym_entry *
 		_sinittext = s->addr;
 	else if (strcmp(str, "_einittext") == 0)
 		_einittext = s->addr;
-	else if (toupper(s->type) == 'A' || toupper(s->type) == 'U')
+	else if (toupper(s->type) == 'A') {
+		/* Keep these useful absolute symbols */
+		if (strcmp(str, "__kernel_syscall_via_break") &&
+		    strcmp(str, "__kernel_syscall_via_epc") &&
+		    strcmp(str, "__kernel_sigtramp") &&
+		    strcmp(str, "__gp"))
+			return -1;
+	} else if (toupper(s->type) == 'U')
 		return -1;
 
 	/* include the type field in the symbol name, so that it gets
#1 lore raw
Quoted 9 lines · Keith Owens

Some absolute symbols are useful, they can even appear in back traces. Tweak kallsyms to retain the useful absolute symbols.

---

This list is from ia64, add absolute symbols from other architectures as required.

I've applied the following patch (clash with some arm changes):
===== scripts/kallsyms.c 1.14 vs edited =====

scripts/kallsyms.c +11 -1
@@ -132,7 +132,17 @@
 		_sinittext = s->addr;
 	else if (strcmp(str, "_einittext") == 0)
 		_einittext = s->addr;
-	else if (toupper(s->type) == 'A' || toupper(s->type) == 'U' ||
+	else if (toupper(s->type) == 'A')
+	{
+		/* Keep these useful absolute symbols */
+		if (strcmp(str, "__kernel_syscall_via_break") &&
+		    strcmp(str, "__kernel_syscall_via_epc") &&
+		    strcmp(str, "__kernel_sigtramp") &&
+		    strcmp(str, "__gp"))
+			return -1;
+
+	}
+	else if (toupper(s->type) == 'U' ||
 		 is_arm_mapping_symbol(str))
 		return -1;