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.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -592,6 +592,14 @@ static int strrcmp(const char *s, const char *sub) · 591 unmodified lines | ||
| 592 | 592 | * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one, *_console |
| 593 | 593 | * |
| 594 | 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 | 603 | * Some symbols belong to init section but still it is ok to reference |
| 596 | 604 | * these from non-init sections as these symbols don't have any memory |
| 597 | 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) · 1 unmodified line | ||
| 599 | 607 | * For ex. symbols marking the init section boundaries. |
| 600 | 608 | * This pattern is identified by |
| 601 | 609 | * refsymname = __init_begin, _sinittext, _einittext |
| 602 | − * Pattern 4: | |
| 610 | + * | |
| 611 | + * Pattern 6: | |
| 603 | 612 | * During the early init phase we have references from .init.text to |
| 604 | 613 | * .text we have an intended section mismatch - do not warn about it. |
| 605 | 614 | * 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 | 666 | if (f1 && f2) |
| 658 | 667 | return 1; |
| 659 | 668 | |
| 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; | |
| 673 | 673 | |
| 674 | − /* Check for pattern 3 */ | |
| 675 | − for (s = pat3refsym; *s; s++) | |
| 676 | − if (strcmp(refsymname, *s) == 0) | |
| 677 | − return 1; | |
| 678 | − } | |
| 679 | 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 | 686 | if ((strcmp(tosec, ".init.text") == 0) && |
| 681 | 687 | (strcmp(fromsec, ".text") == 0) && |
| 682 | 688 | (strcmp(refsymname, "kernel_init") == 0)) |