kallsyms: expand symbol name into comment for debugging
authorArnd Bergmann <arnd@arndb.de>
Mon, 6 Mar 2023 10:14:51 +0000 (11:14 +0100)
committerMasahiro Yamada <masahiroy@kernel.org>
Mon, 17 Apr 2023 02:03:56 +0000 (11:03 +0900)
The assembler output of kallsyms.c is not meant for people to understand,
and is generally not helpful when debugging "Inconsistent kallsyms data"
warnings. I have previously struggled with these, but found it helpful
to list which symbols changed between the first and second pass in the
.tmp_vmlinux.kallsyms*.S files.

As this file is preprocessed, it's possible to add a C-style multiline
comment with the full type/name tuple.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
scripts/kallsyms.c

index a239a87e7bec1c75ffba780d291fb7493c868780..ea1e3d3aaa6b1e03ee26ef9ab68bb6767e4985d1 100644 (file)
@@ -525,7 +525,8 @@ static void write_src(void)
                                        table[i]->addr);
                                exit(EXIT_FAILURE);
                        }
-                       printf("\t.long\t%#x\n", (int)offset);
+                       expand_symbol(table[i]->sym, table[i]->len, buf);
+                       printf("\t.long\t%#x    /* %s */\n", (int)offset, buf);
                } else if (!symbol_absolute(table[i])) {
                        output_address(table[i]->addr);
                } else {