X-Git-Url: http://git.osdn.net/view?a=blobdiff_plain;f=scripts%2Fmod%2Fmodpost.c;fp=scripts%2Fmod%2Fmodpost.c;h=1c2101bf63d2c023bbe3941fa5fa49f39196f1d8;hb=09c20c032b0f753969ae778d9783d946f054d7fe;hp=45e4027d31938565fb21e58dffe2afb22295fc53;hpb=c5c3439af0f9c08e253d2a703a7eb3deba7d8591;p=uclinux-h8%2Flinux.git 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) * "foo" will match an exact string equal to "foo" * "*foo" will match a string that ends with "foo" * "foo*" will match a string that begins with "foo" + * "*foo*" will match a string that contains "foo" */ static int match(const char *sym, const char * const pat[]) { @@ -784,8 +785,17 @@ static int match(const char *sym, const char * const pat[]) p = *pat++; const char *endp = p + strlen(p) - 1; + /* "*foo*" */ + if (*p == '*' && *endp == '*') { + char *here, *bare = strndup(p + 1, strlen(p) - 2); + + here = strstr(sym, bare); + free(bare); + if (here != NULL) + return 1; + } /* "*foo" */ - if (*p == '*') { + else if (*p == '*') { if (strrcmp(sym, p + 1) == 0) return 1; }