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
592 * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console592 * 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 reference603 * 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 memory604 * 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 even605 * 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
599 * For ex. symbols marking the init section boundaries.607 * For ex. symbols marking the init section boundaries.
600 * This pattern is identified by608 * This pattern is identified by
601 * refsymname = __init_begin, _sinittext, _einittext609 * refsymname = __init_begin, _sinittext, _einittext
602 * Pattern 4:610 *
611 * Pattern 6:
603 * During the early init phase we have references from .init.text to612 * 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.c614 * See kernel_init() in init/main.c
@@ -657,26 +666,23 @@ static int secref_whitelist(const char *modname, const char *tosec, · 51 unmodified lines
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 vmlinux669 /* Check for pattern 3 */
661 * Whitelist all refereces from .text.head to .init.data if vmlinux670 if ((strncmp(fromsec, ".pci_fixup", strlen(".pci_fixup")) == 0) &&
662 * Whitelist all refereces from .text.head to .init.text if vmlinux671 (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))

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