diff options
author | Rusty Russell <rusty@rustcorp.com.au> | 2010-08-12 01:04:16 -0400 |
---|---|---|
committer | Rusty Russell <rusty@rustcorp.com.au> | 2010-08-11 09:34:17 -0400 |
commit | 6a841528d288ac420052f5c98fd426b0fcdc5b52 (patch) | |
tree | 2de0658e11c12e96a2e08e8793c61bf3ab728840 /scripts/mod | |
parent | 549a8a030693912d5ec4106c2f538593c482a1e4 (diff) |
param: silence .init.text references from param ops
Ideally, we'd check that it was only the "set" function which was __init,
and that the permissions were r/o. But that's a little hard.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Tested-by: Phil Carmody <ext-phil.2.carmody@nokia.com>
Diffstat (limited to 'scripts/mod')
-rw-r--r-- | scripts/mod/modpost.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 1ce655dde99e..b16044002d91 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -1033,6 +1033,13 @@ static const struct sectioncheck *section_mismatch( | |||
1033 | * fromsec = .data* | 1033 | * fromsec = .data* |
1034 | * atsym =__param* | 1034 | * atsym =__param* |
1035 | * | 1035 | * |
1036 | * Pattern 1a: | ||
1037 | * module_param_call() ops can refer to __init set function if permissions=0 | ||
1038 | * The pattern is identified by: | ||
1039 | * tosec = .init.text | ||
1040 | * fromsec = .data* | ||
1041 | * atsym = __param_ops_* | ||
1042 | * | ||
1036 | * Pattern 2: | 1043 | * Pattern 2: |
1037 | * Many drivers utilise a *driver container with references to | 1044 | * Many drivers utilise a *driver container with references to |
1038 | * add, remove, probe functions etc. | 1045 | * add, remove, probe functions etc. |
@@ -1067,6 +1074,12 @@ static int secref_whitelist(const struct sectioncheck *mismatch, | |||
1067 | (strncmp(fromsym, "__param", strlen("__param")) == 0)) | 1074 | (strncmp(fromsym, "__param", strlen("__param")) == 0)) |
1068 | return 0; | 1075 | return 0; |
1069 | 1076 | ||
1077 | /* Check for pattern 1a */ | ||
1078 | if (strcmp(tosec, ".init.text") == 0 && | ||
1079 | match(fromsec, data_sections) && | ||
1080 | (strncmp(fromsym, "__param_ops_", strlen("__param_ops_")) == 0)) | ||
1081 | return 0; | ||
1082 | |||
1070 | /* Check for pattern 2 */ | 1083 | /* Check for pattern 2 */ |
1071 | if (match(tosec, init_exit_sections) && | 1084 | if (match(tosec, init_exit_sections) && |
1072 | match(fromsec, data_sections) && | 1085 | match(fromsec, data_sections) && |