diff options
Diffstat (limited to 'scripts/mod')
| -rw-r--r-- | scripts/mod/modpost.c | 23 | ||||
| -rw-r--r-- | scripts/mod/sumversion.c | 19 |
2 files changed, 32 insertions, 10 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index e8fba959fffb..cd104afcc5f2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
| @@ -1248,6 +1248,19 @@ static int is_function(Elf_Sym *sym) | |||
| 1248 | return -1; | 1248 | return -1; |
| 1249 | } | 1249 | } |
| 1250 | 1250 | ||
| 1251 | static void print_section_list(const char * const list[20]) | ||
| 1252 | { | ||
| 1253 | const char *const *s = list; | ||
| 1254 | |||
| 1255 | while (*s) { | ||
| 1256 | fprintf(stderr, "%s", *s); | ||
| 1257 | s++; | ||
| 1258 | if (*s) | ||
| 1259 | fprintf(stderr, ", "); | ||
| 1260 | } | ||
| 1261 | fprintf(stderr, "\n"); | ||
| 1262 | } | ||
| 1263 | |||
| 1251 | /* | 1264 | /* |
| 1252 | * Print a warning about a section mismatch. | 1265 | * Print a warning about a section mismatch. |
| 1253 | * Try to find symbols near it so user can find it. | 1266 | * Try to find symbols near it so user can find it. |
| @@ -1304,7 +1317,6 @@ static void report_sec_mismatch(const char *modname, | |||
| 1304 | break; | 1317 | break; |
| 1305 | case DATA_TO_ANY_INIT: { | 1318 | case DATA_TO_ANY_INIT: { |
| 1306 | prl_to = sec2annotation(tosec); | 1319 | prl_to = sec2annotation(tosec); |
| 1307 | const char *const *s = mismatch->symbol_white_list; | ||
| 1308 | fprintf(stderr, | 1320 | fprintf(stderr, |
| 1309 | "The variable %s references\n" | 1321 | "The variable %s references\n" |
| 1310 | "the %s %s%s%s\n" | 1322 | "the %s %s%s%s\n" |
| @@ -1312,9 +1324,7 @@ static void report_sec_mismatch(const char *modname, | |||
| 1312 | "variable with __init* or __refdata (see linux/init.h) " | 1324 | "variable with __init* or __refdata (see linux/init.h) " |
| 1313 | "or name the variable:\n", | 1325 | "or name the variable:\n", |
| 1314 | fromsym, to, prl_to, tosym, to_p); | 1326 | fromsym, to, prl_to, tosym, to_p); |
| 1315 | while (*s) | 1327 | print_section_list(mismatch->symbol_white_list); |
| 1316 | fprintf(stderr, "%s, ", *s++); | ||
| 1317 | fprintf(stderr, "\n"); | ||
| 1318 | free(prl_to); | 1328 | free(prl_to); |
| 1319 | break; | 1329 | break; |
| 1320 | } | 1330 | } |
| @@ -1329,7 +1339,6 @@ static void report_sec_mismatch(const char *modname, | |||
| 1329 | break; | 1339 | break; |
| 1330 | case DATA_TO_ANY_EXIT: { | 1340 | case DATA_TO_ANY_EXIT: { |
| 1331 | prl_to = sec2annotation(tosec); | 1341 | prl_to = sec2annotation(tosec); |
| 1332 | const char *const *s = mismatch->symbol_white_list; | ||
| 1333 | fprintf(stderr, | 1342 | fprintf(stderr, |
| 1334 | "The variable %s references\n" | 1343 | "The variable %s references\n" |
| 1335 | "the %s %s%s%s\n" | 1344 | "the %s %s%s%s\n" |
| @@ -1337,9 +1346,7 @@ static void report_sec_mismatch(const char *modname, | |||
| 1337 | "variable with __exit* (see linux/init.h) or " | 1346 | "variable with __exit* (see linux/init.h) or " |
| 1338 | "name the variable:\n", | 1347 | "name the variable:\n", |
| 1339 | fromsym, to, prl_to, tosym, to_p); | 1348 | fromsym, to, prl_to, tosym, to_p); |
| 1340 | while (*s) | 1349 | print_section_list(mismatch->symbol_white_list); |
| 1341 | fprintf(stderr, "%s, ", *s++); | ||
| 1342 | fprintf(stderr, "\n"); | ||
| 1343 | free(prl_to); | 1350 | free(prl_to); |
| 1344 | break; | 1351 | break; |
| 1345 | } | 1352 | } |
diff --git a/scripts/mod/sumversion.c b/scripts/mod/sumversion.c index ecf9c7dc1825..9dfcd6d988da 100644 --- a/scripts/mod/sumversion.c +++ b/scripts/mod/sumversion.c | |||
| @@ -300,8 +300,8 @@ static int is_static_library(const char *objfile) | |||
| 300 | return 0; | 300 | return 0; |
| 301 | } | 301 | } |
| 302 | 302 | ||
| 303 | /* We have dir/file.o. Open dir/.file.o.cmd, look for deps_ line to | 303 | /* We have dir/file.o. Open dir/.file.o.cmd, look for source_ and deps_ line |
| 304 | * figure out source file. */ | 304 | * to figure out source files. */ |
| 305 | static int parse_source_files(const char *objfile, struct md4_ctx *md) | 305 | static int parse_source_files(const char *objfile, struct md4_ctx *md) |
| 306 | { | 306 | { |
| 307 | char *cmd, *file, *line, *dir; | 307 | char *cmd, *file, *line, *dir; |
| @@ -340,6 +340,21 @@ static int parse_source_files(const char *objfile, struct md4_ctx *md) | |||
| 340 | */ | 340 | */ |
| 341 | while ((line = get_next_line(&pos, file, flen)) != NULL) { | 341 | while ((line = get_next_line(&pos, file, flen)) != NULL) { |
| 342 | char* p = line; | 342 | char* p = line; |
| 343 | |||
| 344 | if (strncmp(line, "source_", sizeof("source_")-1) == 0) { | ||
| 345 | p = strrchr(line, ' '); | ||
| 346 | if (!p) { | ||
| 347 | warn("malformed line: %s\n", line); | ||
| 348 | goto out_file; | ||
| 349 | } | ||
| 350 | p++; | ||
| 351 | if (!parse_file(p, md)) { | ||
| 352 | warn("could not open %s: %s\n", | ||
| 353 | p, strerror(errno)); | ||
| 354 | goto out_file; | ||
| 355 | } | ||
| 356 | continue; | ||
| 357 | } | ||
| 343 | if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) { | 358 | if (strncmp(line, "deps_", sizeof("deps_")-1) == 0) { |
| 344 | check_files = 1; | 359 | check_files = 1; |
| 345 | continue; | 360 | continue; |
