Skip to content

Commit c7299d9

Browse files
committed
modpost: turn section mismatches to error from fatal()
There is code that reports static EXPORT_SYMBOL a few lines below. It is not a good idea to bail out here. I renamed sec_mismatch_fatal to sec_mismatch_warn_only (with logical inversion) to match to CONFIG_SECTION_MISMATCH_WARN_ONLY. Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
1 parent d6d692f commit c7299d9

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

‎scripts/mod/modpost.c‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ static int external_module = 0;
3434
static int warn_unresolved = 0;
3535
/* How a symbol is exported */
3636
static int sec_mismatch_count = 0;
37-
static int sec_mismatch_fatal = 0;
37+
static int sec_mismatch_warn_only = true;
3838
/* ignore missing files */
3939
static int ignore_missing_files;
4040
/* If set to 1, only warn (instead of error) about missing ns imports */
@@ -2576,7 +2576,7 @@ int main(int argc, char **argv)
25762576
warn_unresolved = 1;
25772577
break;
25782578
case 'E':
2579-
sec_mismatch_fatal = 1;
2579+
sec_mismatch_warn_only = false;
25802580
break;
25812581
case 'N':
25822582
allow_missing_ns_imports = 1;
@@ -2640,8 +2640,8 @@ int main(int argc, char **argv)
26402640

26412641
if (dump_write)
26422642
write_dump(dump_write);
2643-
if (sec_mismatch_count && sec_mismatch_fatal)
2644-
fatal("Section mismatches detected.\n"
2643+
if (sec_mismatch_count && !sec_mismatch_warn_only)
2644+
error("Section mismatches detected.\n"
26452645
"Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
26462646
for (n = 0; n < SYMBOL_HASH_SIZE; n++) {
26472647
struct symbol *s;

0 commit comments

Comments
 (0)