Whitelist references from __dbe_table to .init
[safe/jmp/linux-2.6] / scripts / mod / modpost.c
index 015c6b0..04579a5 100644 (file)
@@ -75,7 +75,8 @@ static int is_vmlinux(const char *modname)
        else
                myname = modname;
 
-       return strcmp(myname, "vmlinux") == 0;
+       return (strcmp(myname, "vmlinux") == 0) ||
+              (strcmp(myname, "vmlinux.o") == 0);
 }
 
 void *do_nofail(void *ptr, const char *expr)
@@ -608,8 +609,8 @@ static int strrcmp(const char *s, const char *sub)
  *   warn here.
  *   the pattern is identified by:
  *   tosec   = .init.text | .exit.text | .init.data
- *   fromsec = .data
- *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
+ *   fromsec = .data | .data.rel | .data.rel.*
+ *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console, *_timer
  *
  * Pattern 3:
  *   Whitelist all refereces from .text.head to .init.data
@@ -634,6 +635,7 @@ static int secref_whitelist(const char *modname, const char *tosec,
        const char *pat2sym[] = {
                "driver",
                "_template", /* scsi uses *_template a lot */
+               "_timer",    /* arm uses ops structures named _timer a lot */
                "_sht",      /* scsi also used *_sht to some extent */
                "_ops",
                "_probe",
@@ -670,7 +672,9 @@ static int secref_whitelist(const char *modname, const char *tosec,
            (strcmp(tosec, ".exit.text") != 0) &&
            (strcmp(tosec, ".init.data") != 0))
                f2 = 0;
-       if (strcmp(fromsec, ".data") != 0)
+       if ((strcmp(fromsec, ".data") != 0) &&
+           (strcmp(fromsec, ".data.rel") != 0) &&
+           (strncmp(fromsec, ".data.rel.", strlen(".data.rel.")) != 0))
                f2 = 0;
 
        for (s = pat2sym; *s; s++)
@@ -1137,6 +1141,7 @@ static int init_section_ref_ok(const char *name)
        const char **s;
        /* Absolute section names */
        const char *namelist1[] = {
+               "__dbe_table",          /* MIPS generate these */
                "__ftr_fixup",          /* powerpc cpu feature fixup */
                "__fw_ftr_fixup",       /* powerpc firmware feature fixup */
                "__param",