diff options
-rw-r--r-- | scripts/mod/modpost.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index dfde0e87a765..5028d46a8f35 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -581,8 +581,8 @@ static int strrcmp(const char *s, const char *sub) | |||
581 | * fromsec = .data | 581 | * fromsec = .data |
582 | * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one | 582 | * atsym = *driver, *_template, *_sht, *_ops, *_probe, *probe_one |
583 | **/ | 583 | **/ |
584 | static int secref_whitelist(const char *tosec, const char *fromsec, | 584 | static int secref_whitelist(const char *modname, const char *tosec, |
585 | const char *atsym) | 585 | const char *fromsec, const char *atsym) |
586 | { | 586 | { |
587 | int f1 = 1, f2 = 1; | 587 | int f1 = 1, f2 = 1; |
588 | const char **s; | 588 | const char **s; |
@@ -618,8 +618,15 @@ static int secref_whitelist(const char *tosec, const char *fromsec, | |||
618 | for (s = pat2sym; *s; s++) | 618 | for (s = pat2sym; *s; s++) |
619 | if (strrcmp(atsym, *s) == 0) | 619 | if (strrcmp(atsym, *s) == 0) |
620 | f1 = 1; | 620 | f1 = 1; |
621 | if (f1 && f2) | ||
622 | return 1; | ||
621 | 623 | ||
622 | return f1 && f2; | 624 | /* Whitelist all references from .pci_fixup section if vmlinux */ |
625 | if (is_vmlinux(modname)) { | ||
626 | if ((strcmp(fromsec, ".pci_fixup") == 0) && | ||
627 | (strcmp(tosec, ".init.text") == 0)) | ||
628 | return 1; | ||
629 | } | ||
623 | } | 630 | } |
624 | 631 | ||
625 | /** | 632 | /** |
@@ -726,7 +733,8 @@ static void warn_sec_mismatch(const char *modname, const char *fromsec, | |||
726 | 733 | ||
727 | /* check whitelist - we may ignore it */ | 734 | /* check whitelist - we may ignore it */ |
728 | if (before && | 735 | if (before && |
729 | secref_whitelist(secname, fromsec, elf->strtab + before->st_name)) | 736 | secref_whitelist(modname, secname, fromsec, |
737 | elf->strtab + before->st_name)) | ||
730 | return; | 738 | return; |
731 | 739 | ||
732 | if (before && after) { | 740 | if (before && after) { |