diff options
author | Masahiro Yamada <masahiroy@kernel.org> | 2023-06-11 17:50:58 +0200 |
---|---|---|
committer | Masahiro Yamada <masahiroy@kernel.org> | 2023-06-22 14:21:06 +0200 |
commit | 78dac1a22944910ba5c1475c384309d30c99afaa (patch) | |
tree | d1567abe4ef521efd1e5e5a58f66ed8acfd127a0 /scripts/mod | |
parent | kbuild: implement CONFIG_TRIM_UNUSED_KSYMS without recursion (diff) | |
download | linux-78dac1a22944910ba5c1475c384309d30c99afaa.tar.xz linux-78dac1a22944910ba5c1475c384309d30c99afaa.zip |
modpost: merge two similar section mismatch warnings
In case of section mismatch, modpost shows slightly different messages.
For extable section mismatch:
"%s(%s+0x%lx): Section mismatch in reference to the %s:%s\n"
For the other cases:
"%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n"
They are similar. Merge them.
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/modpost.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 3d9f3e2b2a2d..c7faa455f978 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c @@ -1147,21 +1147,10 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, sec_mismatch_count++; - switch (mismatch->mismatch) { - case TEXT_TO_ANY_INIT: - case DATA_TO_ANY_INIT: - case TEXTDATA_TO_ANY_EXIT: - case XXXINIT_TO_SOME_INIT: - case XXXEXIT_TO_SOME_EXIT: - case ANY_INIT_TO_ANY_EXIT: - case ANY_EXIT_TO_ANY_INIT: - warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n", - modname, fromsym, fromsec, tosym, tosec); - break; - case EXTABLE_TO_NON_TEXT: - warn("%s(%s+0x%lx): Section mismatch in reference to the %s:%s\n", - modname, fromsec, (long)faddr, tosec, tosym); + warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n", + modname, fromsym, fromsec, tosym, tosec); + if (mismatch->mismatch == EXTABLE_TO_NON_TEXT) { if (match(tosec, mismatch->bad_tosec)) fatal("The relocation at %s+0x%lx references\n" "section \"%s\" which is black-listed.\n" @@ -1181,7 +1170,6 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf, else error("%s+0x%lx references non-executable section '%s'\n", fromsec, (long)faddr, tosec); - break; } } |