summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorMasahiro Yamada <masahiroy@kernel.org>2023-06-11 17:50:59 +0200
committerMasahiro Yamada <masahiroy@kernel.org>2023-06-22 14:21:06 +0200
commitf234627898d7644998e28938390fa3d63efeefb7 (patch)
treec4942186ad3600c1d39104beee010ce740011a0c /scripts
parentmodpost: merge two similar section mismatch warnings (diff)
downloadlinux-f234627898d7644998e28938390fa3d63efeefb7.tar.xz
linux-f234627898d7644998e28938390fa3d63efeefb7.zip
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')
-rw-r--r--scripts/mod/modpost.c4
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))