Skip to content

Commit f234627

Browse files
committed
modpost: show offset from symbol for section mismatch warnings
Currently, modpost only shows the symbol names and section names, so it repeats the same message if there are multiple relocations in the same symbol. It is common the relocation spans across multiple instructions. It is better to show the offset from the symbol. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org> Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
1 parent 78dac1a commit f234627

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

scripts/mod/modpost.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1147,8 +1147,8 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
11471147

11481148
sec_mismatch_count++;
11491149

1150-
warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n",
1151-
modname, fromsym, fromsec, tosym, tosec);
1150+
warn("%s: section mismatch in reference: %s+0x%x (section: %s) -> %s (section: %s)\n",
1151+
modname, fromsym, (unsigned int)(faddr - from->st_value), fromsec, tosym, tosec);
11521152

11531153
if (mismatch->mismatch == EXTABLE_TO_NON_TEXT) {
11541154
if (match(tosec, mismatch->bad_tosec))

0 commit comments

Comments
 (0)