diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2023-06-11 18:50:59 +0300 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-06-22 15:21:06 +0300 |
commit | f234627898d7644998e28938390fa3d63efeefb7 (patch) | |
tree | c4942186ad3600c1d39104beee010ce740011a0c /scripts/mod/modpost.c | |
parent | 78dac1a22944910ba5c1475c384309d30c99afaa (diff) | |
download | linux-f234627898d7644998e28938390fa3d63efeefb7.tar.xz |
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>
Diffstat (limited to 'scripts/mod/modpost.c')
-rw-r--r-- | scripts/mod/modpost.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index c7faa455f978..39cf43d61d51 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1147,8 +1147,8 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, sec_mismatch_count++; - warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n", - modname, fromsym, fromsec, tosym, tosec); + warn("%s: section mismatch in reference: %s+0x%x (section: %s) -> %s (section: %s)\n", + modname, fromsym, (unsigned int)(faddr - from->st_value), fromsec, tosym, tosec); if (mismatch->mismatch == EXTABLE_TO_NON_TEXT) { if (match(tosec, mismatch->bad_tosec)) |