Merge branch 'params' of git://git.kernel.org/pub/scm/linux/kernel/git/rusty/linux...
[sfrench/cifs-2.6.git] / scripts / mod / modpost.c
index 7acbdd8fcaedae983d57e7c4d74e3570d98f3484..1ec7158b6c1f67e7264260c5995842d93854ee42 100644 (file)
@@ -790,6 +790,7 @@ static const char *section_white_list[] =
 {
        ".comment*",
        ".debug*",
+       ".GCC-command-line",    /* mn10300 */
        ".mdebug*",        /* alpha, score, mips etc. */
        ".pdr",            /* alpha, score, mips etc. */
        ".stab*",
@@ -1034,6 +1035,13 @@ static const struct sectioncheck *section_mismatch(
  *   fromsec = .data*
  *   atsym   =__param*
  *
+ * Pattern 1a:
+ *   module_param_call() ops can refer to __init set function if permissions=0
+ *   The pattern is identified by:
+ *   tosec   = .init.text
+ *   fromsec = .data*
+ *   atsym   = __param_ops_*
+ *
  * Pattern 2:
  *   Many drivers utilise a *driver container with references to
  *   add, remove, probe functions etc.
@@ -1068,6 +1076,12 @@ static int secref_whitelist(const struct sectioncheck *mismatch,
            (strncmp(fromsym, "__param", strlen("__param")) == 0))
                return 0;
 
+       /* Check for pattern 1a */
+       if (strcmp(tosec, ".init.text") == 0 &&
+           match(fromsec, data_sections) &&
+           (strncmp(fromsym, "__param_ops_", strlen("__param_ops_")) == 0))
+               return 0;
+
        /* Check for pattern 2 */
        if (match(tosec, init_exit_sections) &&
            match(fromsec, data_sections) &&