| @@ -38,6 +38,7 @@ static int warn_unresolved = 0; · 37 unmodified lines |
| 38 | 38 | /* How a symbol is exported */ |
| 39 | 39 | static int sec_mismatch_count = 0; |
| 40 | 40 | static int sec_mismatch_verbose = 1; |
| 41 | +static int sec_mismatch_fatal = 0; |
| 41 | 42 | /* ignore missing files */ |
| 42 | 43 | static int ignore_missing_files; |
| 43 | 44 | |
| @@ -2385,7 +2386,7 @@ int main(int argc, char **argv) · 2341 unmodified lines |
| 2385 | 2386 | struct ext_sym_list *extsym_iter; |
| 2386 | 2387 | struct ext_sym_list *extsym_start = NULL; |
| 2387 | 2388 | |
| 2388 | | − while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awM:K:")) != -1) { |
| 2389 | + while ((opt = getopt(argc, argv, "i:I:e:mnsST:o:awM:K:E")) != -1) { |
| 2389 | 2390 | switch (opt) { |
| 2390 | 2391 | case 'i': |
| 2391 | 2392 | kernel_read = optarg; |
| @@ -2426,6 +2427,9 @@ int main(int argc, char **argv) · 34 unmodified lines |
| 2426 | 2427 | case 'w': |
| 2427 | 2428 | warn_unresolved = 1; |
| 2428 | 2429 | break; |
| 2430 | + case 'E': |
| 2431 | + sec_mismatch_fatal = 1; |
| 2432 | + break; |
| 2429 | 2433 | default: |
| 2430 | 2434 | exit(1); |
| 2431 | 2435 | } |
| @@ -2475,14 +2479,20 @@ int main(int argc, char **argv) · 43 unmodified lines |
| 2475 | 2479 | sprintf(fname, "%s.mod.c", mod->name); |
| 2476 | 2480 | write_if_changed(&buf, fname); |
| 2477 | 2481 | } |
| 2478 | | − |
| 2479 | 2482 | if (dump_write) |
| 2480 | 2483 | write_dump(dump_write); |
| 2481 | | − if (sec_mismatch_count && !sec_mismatch_verbose) |
| 2482 | | − warn("modpost: Found %d section mismatch(es).\n" |
| 2483 | | − "To see full details build your kernel with:\n" |
| 2484 | | − "'make CONFIG_DEBUG_SECTION_MISMATCH=y'\n", |
| 2485 | | − sec_mismatch_count); |
| 2484 | + if (sec_mismatch_count) { |
| 2485 | + if (!sec_mismatch_verbose) { |
| 2486 | + warn("modpost: Found %d section mismatch(es).\n" |
| 2487 | + "To see full details build your kernel with:\n" |
| 2488 | + "'make CONFIG_DEBUG_SECTION_MISMATCH=y'\n", |
| 2489 | + sec_mismatch_count); |
| 2490 | + } |
| 2491 | + if (sec_mismatch_fatal) { |
| 2492 | + fatal("modpost: Section mismatches detected.\n" |
| 2493 | + "Set CONFIG_SECTION_MISMATCH_WARN_ONLY=y to allow them.\n"); |
| 2494 | + } |
| 2495 | + } |
| 2486 | 2496 | |
| 2487 | 2497 | return err; |
| 2488 | 2498 | } |