diff options
Diffstat (limited to 'scripts/mod/modpost.c')
| -rw-r--r-- | scripts/mod/modpost.c | 19 |
1 files changed, 17 insertions, 2 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 1ce655dde99e..1ec7158b6c1f 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
| @@ -14,6 +14,7 @@ | |||
| 14 | #define _GNU_SOURCE | 14 | #define _GNU_SOURCE |
| 15 | #include <stdio.h> | 15 | #include <stdio.h> |
| 16 | #include <ctype.h> | 16 | #include <ctype.h> |
| 17 | #include <string.h> | ||
| 17 | #include "modpost.h" | 18 | #include "modpost.h" |
| 18 | #include "../../include/generated/autoconf.h" | 19 | #include "../../include/generated/autoconf.h" |
| 19 | #include "../../include/linux/license.h" | 20 | #include "../../include/linux/license.h" |
| @@ -789,6 +790,7 @@ static const char *section_white_list[] = | |||
| 789 | { | 790 | { |
| 790 | ".comment*", | 791 | ".comment*", |
| 791 | ".debug*", | 792 | ".debug*", |
| 793 | ".GCC-command-line", /* mn10300 */ | ||
| 792 | ".mdebug*", /* alpha, score, mips etc. */ | 794 | ".mdebug*", /* alpha, score, mips etc. */ |
| 793 | ".pdr", /* alpha, score, mips etc. */ | 795 | ".pdr", /* alpha, score, mips etc. */ |
| 794 | ".stab*", | 796 | ".stab*", |
| @@ -1033,6 +1035,13 @@ static const struct sectioncheck *section_mismatch( | |||
| 1033 | * fromsec = .data* | 1035 | * fromsec = .data* |
| 1034 | * atsym =__param* | 1036 | * atsym =__param* |
| 1035 | * | 1037 | * |
| 1038 | * Pattern 1a: | ||
| 1039 | * module_param_call() ops can refer to __init set function if permissions=0 | ||
| 1040 | * The pattern is identified by: | ||
| 1041 | * tosec = .init.text | ||
| 1042 | * fromsec = .data* | ||
| 1043 | * atsym = __param_ops_* | ||
| 1044 | * | ||
| 1036 | * Pattern 2: | 1045 | * Pattern 2: |
| 1037 | * Many drivers utilise a *driver container with references to | 1046 | * Many drivers utilise a *driver container with references to |
| 1038 | * add, remove, probe functions etc. | 1047 | * add, remove, probe functions etc. |
| @@ -1067,6 +1076,12 @@ static int secref_whitelist(const struct sectioncheck *mismatch, | |||
| 1067 | (strncmp(fromsym, "__param", strlen("__param")) == 0)) | 1076 | (strncmp(fromsym, "__param", strlen("__param")) == 0)) |
| 1068 | return 0; | 1077 | return 0; |
| 1069 | 1078 | ||
| 1079 | /* Check for pattern 1a */ | ||
| 1080 | if (strcmp(tosec, ".init.text") == 0 && | ||
| 1081 | match(fromsec, data_sections) && | ||
| 1082 | (strncmp(fromsym, "__param_ops_", strlen("__param_ops_")) == 0)) | ||
| 1083 | return 0; | ||
| 1084 | |||
| 1070 | /* Check for pattern 2 */ | 1085 | /* Check for pattern 2 */ |
| 1071 | if (match(tosec, init_exit_sections) && | 1086 | if (match(tosec, init_exit_sections) && |
| 1072 | match(fromsec, data_sections) && | 1087 | match(fromsec, data_sections) && |
| @@ -1217,7 +1232,7 @@ static char *sec2annotation(const char *s) | |||
| 1217 | strcat(p, " "); | 1232 | strcat(p, " "); |
| 1218 | return r; /* we leak her but we do not care */ | 1233 | return r; /* we leak her but we do not care */ |
| 1219 | } else { | 1234 | } else { |
| 1220 | return ""; | 1235 | return strdup(""); |
| 1221 | } | 1236 | } |
| 1222 | } | 1237 | } |
| 1223 | 1238 | ||
| @@ -1352,7 +1367,7 @@ static void report_sec_mismatch(const char *modname, | |||
| 1352 | "%s%s so it may be used outside an exit section.\n", | 1367 | "%s%s so it may be used outside an exit section.\n", |
| 1353 | from, prl_from, fromsym, from_p, | 1368 | from, prl_from, fromsym, from_p, |
| 1354 | to, prl_to, tosym, to_p, | 1369 | to, prl_to, tosym, to_p, |
| 1355 | sec2annotation(tosec), tosym, to_p); | 1370 | prl_to, tosym, to_p); |
| 1356 | free(prl_from); | 1371 | free(prl_from); |
| 1357 | free(prl_to); | 1372 | free(prl_to); |
| 1358 | break; | 1373 | break; |
