Merge git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild
[powerpc.git] / scripts / mod / modpost.c
index 5f2ecd5..4ab36de 100644 (file)
@@ -55,6 +55,17 @@ void warn(const char *fmt, ...)
        va_end(arglist);
 }
 
+void merror(const char *fmt, ...)
+{
+       va_list arglist;
+
+       fprintf(stderr, "ERROR: ");
+
+       va_start(arglist, fmt);
+       vfprintf(stderr, fmt, arglist);
+       va_end(arglist);
+}
+
 static int is_vmlinux(const char *modname)
 {
        const char *myname;
@@ -615,7 +626,6 @@ static int strrcmp(const char *s, const char *sub)
  *   tosec   = .init.text
  *   fromsec = .text
  *   atsym = kernel_init
- *   Some symbols belong to init section but still it is ok to reference
  *
  * Pattern 7:
  *  Logos used in drivers/video/logo reside in __initdata but the
@@ -625,6 +635,13 @@ static int strrcmp(const char *s, const char *sub)
  *  tosec      = .init.data
  *  fromsec    = .text*
  *  refsymname = logo_
+ *
+ * Pattern 8:
+ *  Symbols contained in .paravirtprobe may safely reference .init.text.
+ *  The pattern is:
+ *  tosec   = .init.text
+ *  fromsec  = .paravirtprobe
+ *
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
                            const char *fromsec, const char *atsym,
@@ -640,6 +657,7 @@ static int secref_whitelist(const char *modname, const char *tosec,
                "_probe",
                "_probe_one",
                "_console",
+               "apic_es7000",
                NULL
        };
 
@@ -702,6 +720,12 @@ static int secref_whitelist(const char *modname, const char *tosec,
            (strncmp(fromsec, ".text", strlen(".text")) == 0) &&
            (strncmp(refsymname, "logo_", strlen("logo_")) == 0))
                return 1;
+
+       /* Check for pattern 8 */
+       if ((strcmp(tosec, ".init.text") == 0) &&
+           (strcmp(fromsec, ".paravirtprobe") == 0))
+               return 1;
+
        return 0;
 }
 
@@ -1307,9 +1331,14 @@ static int add_versions(struct buffer *b, struct module *mod)
                exp = find_symbol(s->name);
                if (!exp || exp->module == mod) {
                        if (have_vmlinux && !s->weak) {
-                               warn("\"%s\" [%s.ko] undefined!\n",
-                                    s->name, mod->name);
-                               err = warn_unresolved ? 0 : 1;
+                               if (warn_unresolved) {
+                                       warn("\"%s\" [%s.ko] undefined!\n",
+                                            s->name, mod->name);
+                               } else {
+                                       merror("\"%s\" [%s.ko] undefined!\n",
+                                                 s->name, mod->name);
+                                       err = 1;
+                               }
                        }
                        continue;
                }