aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2007-02-26 11:49:06 -0500
committerSam Ravnborg <sam@ravnborg.org>2007-05-02 14:58:07 -0400
commit9bf8cb9b7908383752b1842eae78269f7e16d9fb (patch)
tree9f6e1c879c3723574939e4f491d8eacaea8830f2 /scripts
parentaae5f662a32c35b1a962627535acb588d48ff5f9 (diff)
kbuild: fix warnings from .pci_fixup section
Now where we do not pass vmlinux to modpost we started to see section mismatch warnings from .pci_fixup. Refactored code a little to include these in the whitelist again. Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/mod/modpost.c44
1 files changed, 25 insertions, 19 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index be0827f734c2..e1f2b31cf34b 100644
--- a/scripts/mod/modpost.c
+++ b/scripts/mod/modpost.c
@@ -592,6 +592,14 @@ static int strrcmp(const char *s, const char *sub)
592 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console 592 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
593 * 593 *
594 * Pattern 3: 594 * Pattern 3:
595 * Whitelist all references from .pci_fixup* section to .init.text
596 * This is part of the PCI init when built-in
597 *
598 * Pattern 4:
599 * Whitelist all refereces from .text.head to .init.data
600 * Whitelist all refereces from .text.head to .init.text
601 *
602 * Pattern 5:
595 * Some symbols belong to init section but still it is ok to reference 603 * Some symbols belong to init section but still it is ok to reference
596 * these from non-init sections as these symbols don't have any memory 604 * these from non-init sections as these symbols don't have any memory
597 * allocated for them and symbol address and value are same. So even 605 * allocated for them and symbol address and value are same. So even
@@ -599,7 +607,8 @@ static int strrcmp(const char *s, const char *sub)
599 * For ex. symbols marking the init section boundaries. 607 * For ex. symbols marking the init section boundaries.
600 * This pattern is identified by 608 * This pattern is identified by
601 * refsymname = __init_begin, _sinittext, _einittext 609 * refsymname = __init_begin, _sinittext, _einittext
602 * Pattern 4: 610 *
611 * Pattern 6:
603 * During the early init phase we have references from .init.text to 612 * 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. 613 * .text we have an intended section mismatch - do not warn about it.
605 * See kernel_init() in init/main.c 614 * See kernel_init() in init/main.c
@@ -657,26 +666,23 @@ static int secref_whitelist(const char *modname, const char *tosec,
657 if (f1 && f2) 666 if (f1 && f2)
658 return 1; 667 return 1;
659 668
660 /* Whitelist all references from .pci_fixup section if vmlinux 669 /* Check for pattern 3 */
661 * Whitelist all refereces from .text.head to .init.data if vmlinux 670 if ((strncmp(fromsec, ".pci_fixup", strlen(".pci_fixup")) == 0) &&
662 * Whitelist all refereces from .text.head to .init.text if vmlinux 671 (strcmp(tosec, ".init.text") == 0))
663 */ 672 return 1;
664 if (is_vmlinux(modname)) {
665 if ((strcmp(fromsec, ".pci_fixup") == 0) &&
666 (strcmp(tosec, ".init.text") == 0))
667 return 1;
668
669 if ((strcmp(fromsec, ".text.head") == 0) &&
670 ((strcmp(tosec, ".init.data") == 0) ||
671 (strcmp(tosec, ".init.text") == 0)))
672 return 1;
673 673
674 /* Check for pattern 3 */
675 for (s = pat3refsym; *s; s++)
676 if (strcmp(refsymname, *s) == 0)
677 return 1;
678 }
679 /* Check for pattern 4 */ 674 /* Check for pattern 4 */
675 if ((strcmp(fromsec, ".text.head") == 0) &&
676 ((strcmp(tosec, ".init.data") == 0) ||
677 (strcmp(tosec, ".init.text") == 0)))
678 return 1;
679
680 /* Check for pattern 5 */
681 for (s = pat3refsym; *s; s++)
682 if (strcmp(refsymname, *s) == 0)
683 return 1;
684
685 /* Check for pattern 6 */
680 if ((strcmp(tosec, ".init.text") == 0) && 686 if ((strcmp(tosec, ".init.text") == 0) &&
681 (strcmp(fromsec, ".text") == 0) && 687 (strcmp(fromsec, ".text") == 0) &&
682 (strcmp(refsymname, "kernel_init") == 0)) 688 (strcmp(refsymname, "kernel_init") == 0))