Skip to content

Commit

Permalink
kallsyms: expand symbol name into comment for debugging
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Arnd Bergmann authored and Masahiro Yamada committed Apr 17, 2023
1 parent 6a8f57a commit bea5b74
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/kallsyms.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down

0 comments on commit bea5b74

Please sign in to comment.