aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2007-02-26 10:45:41 -0500
committerSam Ravnborg <sam@ravnborg.org>2007-05-02 14:58:07 -0400
commitaae5f662a32c35b1a962627535acb588d48ff5f9 (patch)
tree6e300ed8557e850e350c95dffb57ff9d5d5b182d
parent85bd2fddd68e757da8e1af98f857f61a3c9ce647 (diff)
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 <sam@ravnborg.org>
-rw-r--r--init/main.c6
-rw-r--r--scripts/mod/modpost.c15
2 files changed, 17 insertions, 4 deletions
diff --git a/init/main.c b/init/main.c
index a92989e7836a..7a92b4ca3aad 100644
--- a/init/main.c
+++ b/init/main.c
@@ -82,7 +82,7 @@
82#warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended. 82#warning gcc-4.1.0 is known to miscompile the kernel. A different compiler version is recommended.
83#endif 83#endif
84 84
85static int init(void *); 85static int kernel_init(void *);
86 86
87extern void init_IRQ(void); 87extern void init_IRQ(void);
88extern void fork_init(unsigned long); 88extern void fork_init(unsigned long);
@@ -435,7 +435,7 @@ static void __init setup_command_line(char *command_line)
435static void noinline rest_init(void) 435static void noinline rest_init(void)
436 __releases(kernel_lock) 436 __releases(kernel_lock)
437{ 437{
438 kernel_thread(init, NULL, CLONE_FS | CLONE_SIGHAND); 438 kernel_thread(kernel_init, NULL, CLONE_FS | CLONE_SIGHAND);
439 numa_default_policy(); 439 numa_default_policy();
440 unlock_kernel(); 440 unlock_kernel();
441 441
@@ -772,7 +772,7 @@ static int noinline init_post(void)
772 panic("No init found. Try passing init= option to kernel."); 772 panic("No init found. Try passing init= option to kernel.");
773} 773}
774 774
775static int __init init(void * unused) 775static int __init kernel_init(void * unused)
776{ 776{
777 lock_kernel(); 777 lock_kernel();
778 /* 778 /*
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 1912c752e422..be0827f734c2 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -589,7 +589,7 @@ static int strrcmp(const char *s, const char *sub)
589 * the pattern is identified by: 589 * the pattern is identified by:
590 * tosec = .init.text | .exit.text | .init.data 590 * tosec = .init.text | .exit.text | .init.data
591 * fromsec = .data 591 * fromsec = .data
592 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one 592 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
593 * 593 *
594 * Pattern 3: 594 * Pattern 3:
595 * Some symbols belong to init section but still it is ok to reference 595 * 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)
599 * For ex. symbols marking the init section boundaries. 599 * For ex. symbols marking the init section boundaries.
600 * This pattern is identified by 600 * This pattern is identified by
601 * refsymname = __init_begin, _sinittext, _einittext 601 * refsymname = __init_begin, _sinittext, _einittext
602 * Pattern 4:
603 * During the early init phase we have references from .init.text to
604 * .text we have an intended section mismatch - do not warn about it.
605 * See kernel_init() in init/main.c
606 * tosec = .init.text
607 * fromsec = .text
608 * atsym = kernel_init
609 * Some symbols belong to init section but still it is ok to reference
602 **/ 610 **/
603static int secref_whitelist(const char *modname, const char *tosec, 611static int secref_whitelist(const char *modname, const char *tosec,
604 const char *fromsec, const char *atsym, 612 const char *fromsec, const char *atsym,
@@ -668,6 +676,11 @@ static int secref_whitelist(const char *modname, const char *tosec,
668 if (strcmp(refsymname, *s) == 0) 676 if (strcmp(refsymname, *s) == 0)
669 return 1; 677 return 1;
670 } 678 }
679 /* Check for pattern 4 */
680 if ((strcmp(tosec, ".init.text") == 0) &&
681 (strcmp(fromsec, ".text") == 0) &&
682 (strcmp(refsymname, "kernel_init") == 0))
683 return 1;
671 return 0; 684 return 0;
672} 685}
673 686