Skip to content

Commit 78dac1a

Browse files
committed
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 <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]>
1 parent 5e9e95c commit 78dac1a

File tree

1 file changed

+3
-15
lines changed

1 file changed

+3
-15
lines changed

scripts/mod/modpost.c

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

11481148
sec_mismatch_count++;
11491149

1150-
switch (mismatch->mismatch) {
1151-
case TEXT_TO_ANY_INIT:
1152-
case DATA_TO_ANY_INIT:
1153-
case TEXTDATA_TO_ANY_EXIT:
1154-
case XXXINIT_TO_SOME_INIT:
1155-
case XXXEXIT_TO_SOME_EXIT:
1156-
case ANY_INIT_TO_ANY_EXIT:
1157-
case ANY_EXIT_TO_ANY_INIT:
1158-
warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n",
1159-
modname, fromsym, fromsec, tosym, tosec);
1160-
break;
1161-
case EXTABLE_TO_NON_TEXT:
1162-
warn("%s(%s+0x%lx): Section mismatch in reference to the %s:%s\n",
1163-
modname, fromsec, (long)faddr, tosec, tosym);
1150+
warn("%s: section mismatch in reference: %s (section: %s) -> %s (section: %s)\n",
1151+
modname, fromsym, fromsec, tosym, tosec);
11641152

1153+
if (mismatch->mismatch == EXTABLE_TO_NON_TEXT) {
11651154
if (match(tosec, mismatch->bad_tosec))
11661155
fatal("The relocation at %s+0x%lx references\n"
11671156
"section \"%s\" which is black-listed.\n"
@@ -1181,7 +1170,6 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
11811170
else
11821171
error("%s+0x%lx references non-executable section '%s'\n",
11831172
fromsec, (long)faddr, tosec);
1184-
break;
11851173
}
11861174
}
11871175

0 commit comments

Comments
 (0)