Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=aae5f662a32c35b1a962627535acb588d48ff5f9
Commit:     aae5f662a32c35b1a962627535acb588d48ff5f9
Parent:     85bd2fddd68e757da8e1af98f857f61a3c9ce647
Author:     Sam Ravnborg <[EMAIL PROTECTED]>
AuthorDate: Mon Feb 26 16:45:41 2007 +0100
Committer:  Sam Ravnborg <[EMAIL PROTECTED]>
CommitDate: Wed May 2 20:58:07 2007 +0200

    kbuild: whitelist section mismatch in init/main.c
    
    In init/main.c we have a reference from rest_init() to .init.text
    which is intentional.
    Rename the function 'init' to 'kernel_init' to make it a
    kernel wide unique symbol and whitelist the reference.
    
    Signed-off-by: Sam Ravnborg <[EMAIL PROTECTED]>
---
 init/main.c           |    6 +++---
 scripts/mod/modpost.c |   15 ++++++++++++++-
 2 files changed, 17 insertions(+), 4 deletions(-)

diff --git a/init/main.c b/init/main.c
index a92989e..7a92b4c 100644
--- a/init/main.c
+++ b/init/main.c
@@ -82,7 +82,7 @@
 #warning gcc-4.1.0 is known to miscompile the kernel.  A different compiler 
version is recommended.
 #endif
 
-static int init(void *);
+static int kernel_init(void *);
 
 extern void init_IRQ(void);
 extern void fork_init(unsigned long);
@@ -435,7 +435,7 @@ static void __init setup_command_line(char *command_line)
 static void noinline rest_init(void)
        __releases(kernel_lock)
 {
-       kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND);
+       kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
        numa_default_policy();
        unlock_kernel();
 
@@ -772,7 +772,7 @@ static int noinline init_post(void)
        panic("No init found.  Try passing init= option to kernel.");
 }
 
-static int __init init(void * unused)
+static int __init kernel_init(void * unused)
 {
        lock_kernel();
        /*
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 1912c75..be0827f 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -589,7 +589,7 @@ static int strrcmp(const char *s, const char *sub)
  *   the pattern is identified by:
  *   tosec   = .init.text | .exit.text | .init.data
  *   fromsec = .data
- *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one
+ *   atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
  *
  * Pattern 3:
  *   Some symbols belong to init section but still it is ok to reference
@@ -599,6 +599,14 @@ static int strrcmp(const char *s, const char *sub)
  *   For ex. symbols marking the init section boundaries.
  *   This pattern is identified by
  *   refsymname = __init_begin, _sinittext, _einittext
+ * Pattern 4:
+ *   During the early init phase we have references from .init.text to
+ *   .text we have an intended section mismatch - do not warn about it.
+ *   See kernel_init() in init/main.c
+ *   tosec   = .init.text
+ *   fromsec = .text
+ *   atsym = kernel_init
+ *   Some symbols belong to init section but still it is ok to reference
  **/
 static int secref_whitelist(const char *modname, const char *tosec,
                            const char *fromsec, const char *atsym,
@@ -668,6 +676,11 @@ static int secref_whitelist(const char *modname, const 
char *tosec,
                        if (strcmp(refsymname, *s) == 0)
                                return 1;
        }
+       /* Check for pattern 4 */
+       if ((strcmp(tosec, ".init.text") == 0) &&
+           (strcmp(fromsec, ".text") == 0) &&
+           (strcmp(refsymname, "kernel_init") == 0))
+               return 1;
        return 0;
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to