History

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.

Sam Ravnborg committed 19 years ago

Commit 9bf8cb91 parent aae5f661 file · +25 −19Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/mod/modpost.c+25−19
@@ -592,6 +592,14 @@ static int strrcmp(const char *s, const char *sub) · 591 unmodified lines
592592 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console
593593 *
594594 * 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:
595603 * Some symbols belong to init section but still it is ok to reference
596604 * these from non-init sections as these symbols don't have any memory
597605 * 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) · 1 unmodified line
599607 * For ex. symbols marking the init section boundaries.
600608 * This pattern is identified by
601609 * refsymname = __init_begin, _sinittext, _einittext
602− * Pattern 4:
610+ *
611+ * Pattern 6:
603612 * During the early init phase we have references from .init.text to
604613 * .text we have an intended section mismatch - do not warn about it.
605614 * See kernel_init() in init/main.c
@@ -657,26 +666,23 @@ static int secref_whitelist(const char *modname, const char *tosec, · 51 unmodified lines
657666 if (f1 && f2)
658667 return 1;
659668
660− /* Whitelist all references from .pci_fixup section if vmlinux
661− * Whitelist all refereces from .text.head to .init.data if vmlinux
662− * Whitelist all refereces from .text.head to .init.text if vmlinux
663− */
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;
669+ /* Check for pattern 3 */
670+ if ((strncmp(fromsec, ".pci_fixup", strlen(".pci_fixup")) == 0) &&
671+ (strcmp(tosec, ".init.text") == 0))
672+ return 1;
673673
674− /* Check for pattern 3 */
675− for (s = pat3refsym; *s; s++)
676− if (strcmp(refsymname, *s) == 0)
677− return 1;
678− }
679674 /* 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 */
680686 if ((strcmp(tosec, ".init.text") == 0) &&
681687 (strcmp(fromsec, ".text") == 0) &&
682688 (strcmp(refsymname, "kernel_init") == 0))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t