Skip to content

Commit

Permalink
modpost: turn section mismatches to error from fatal()
Browse files Browse the repository at this point in the history
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 <[email protected]>
  • Loading branch information
masahir0y committed Dec 21, 2020
1 parent d6d692f commit c7299d9
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions scripts/mod/modpost.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ static int external_module = 0;
static int warn_unresolved = 0;
/* How a symbol is exported */
static int sec_mismatch_count = 0;
static int sec_mismatch_fatal = 0;
static int sec_mismatch_warn_only = true;
/* ignore missing files */
static int ignore_missing_files;
/* If set to 1, only warn (instead of error) about missing ns imports */
Expand Down Expand Up @@ -2576,7 +2576,7 @@ int main(int argc, char **argv)
warn_unresolved = 1;
break;
case 'E':
sec_mismatch_fatal = 1;
sec_mismatch_warn_only = false;
break;
case 'N':
allow_missing_ns_imports = 1;
Expand Down Expand Up @@ -2640,8 +2640,8 @@ int main(int argc, char **argv)

if (dump_write)
write_dump(dump_write);
if (sec_mismatch_count && sec_mismatch_fatal)
fatal("Section mismatches detected.\n"
if (sec_mismatch_count && !sec_mismatch_warn_only)
error("Section mismatches detected.\n"
"Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n");
for (n = 0; n < SYMBOL_HASH_SIZE; n++) {
struct symbol *s;
Expand Down

0 comments on commit c7299d9

Please sign in to comment.