diff options
-rw-r--r-- | scripts/mod/modpost.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 45e4027d3193..1c2101bf63d2 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -776,6 +776,7 @@ static const char *sech_name(struct elf_info *elf, Elf_Shdr *sechdr) | |||
776 | * "foo" will match an exact string equal to "foo" | 776 | * "foo" will match an exact string equal to "foo" |
777 | * "*foo" will match a string that ends with "foo" | 777 | * "*foo" will match a string that ends with "foo" |
778 | * "foo*" will match a string that begins with "foo" | 778 | * "foo*" will match a string that begins with "foo" |
779 | * "*foo*" will match a string that contains "foo" | ||
779 | */ | 780 | */ |
780 | static int match(const char *sym, const char * const pat[]) | 781 | static int match(const char *sym, const char * const pat[]) |
781 | { | 782 | { |
@@ -784,8 +785,17 @@ static int match(const char *sym, const char * const pat[]) | |||
784 | p = *pat++; | 785 | p = *pat++; |
785 | const char *endp = p + strlen(p) - 1; | 786 | const char *endp = p + strlen(p) - 1; |
786 | 787 | ||
788 | /* "*foo*" */ | ||
789 | if (*p == '*' && *endp == '*') { | ||
790 | char *here, *bare = strndup(p + 1, strlen(p) - 2); | ||
791 | |||
792 | here = strstr(sym, bare); | ||
793 | free(bare); | ||
794 | if (here != NULL) | ||
795 | return 1; | ||
796 | } | ||
787 | /* "*foo" */ | 797 | /* "*foo" */ |
788 | if (*p == '*') { | 798 | else if (*p == '*') { |
789 | if (strrcmp(sym, p + 1) == 0) | 799 | if (strrcmp(sym, p + 1) == 0) |
790 | return 1; | 800 | return 1; |
791 | } | 801 | } |