diff options
Diffstat (limited to 'scripts/genksyms/genksyms.c')
-rw-r--r-- | scripts/genksyms/genksyms.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scripts/genksyms/genksyms.c b/scripts/genksyms/genksyms.c index d17b7a2b941f..4a350816a9e8 100644 --- a/scripts/genksyms/genksyms.c +++ b/scripts/genksyms/genksyms.c | |||
@@ -156,7 +156,7 @@ static enum symbol_type map_to_ns(enum symbol_type t) | |||
156 | return t; | 156 | return t; |
157 | } | 157 | } |
158 | 158 | ||
159 | struct symbol *find_symbol(const char *name, enum symbol_type ns) | 159 | struct symbol *find_symbol(const char *name, enum symbol_type ns, int exact) |
160 | { | 160 | { |
161 | unsigned long h = crc32(name) % HASH_BUCKETS; | 161 | unsigned long h = crc32(name) % HASH_BUCKETS; |
162 | struct symbol *sym; | 162 | struct symbol *sym; |
@@ -167,6 +167,8 @@ struct symbol *find_symbol(const char *name, enum symbol_type ns) | |||
167 | sym->is_declared) | 167 | sym->is_declared) |
168 | break; | 168 | break; |
169 | 169 | ||
170 | if (exact && sym && sym->type != ns) | ||
171 | return NULL; | ||
170 | return sym; | 172 | return sym; |
171 | } | 173 | } |
172 | 174 | ||
@@ -511,7 +513,7 @@ static unsigned long expand_and_crc_sym(struct symbol *sym, unsigned long crc) | |||
511 | break; | 513 | break; |
512 | 514 | ||
513 | case SYM_TYPEDEF: | 515 | case SYM_TYPEDEF: |
514 | subsym = find_symbol(cur->string, cur->tag); | 516 | subsym = find_symbol(cur->string, cur->tag, 0); |
515 | /* FIXME: Bad reference files can segfault here. */ | 517 | /* FIXME: Bad reference files can segfault here. */ |
516 | if (subsym->expansion_trail) { | 518 | if (subsym->expansion_trail) { |
517 | if (flag_dump_defs) | 519 | if (flag_dump_defs) |
@@ -528,7 +530,7 @@ static unsigned long expand_and_crc_sym(struct symbol *sym, unsigned long crc) | |||
528 | case SYM_STRUCT: | 530 | case SYM_STRUCT: |
529 | case SYM_UNION: | 531 | case SYM_UNION: |
530 | case SYM_ENUM: | 532 | case SYM_ENUM: |
531 | subsym = find_symbol(cur->string, cur->tag); | 533 | subsym = find_symbol(cur->string, cur->tag, 0); |
532 | if (!subsym) { | 534 | if (!subsym) { |
533 | struct string_list *n; | 535 | struct string_list *n; |
534 | 536 | ||
@@ -582,7 +584,7 @@ void export_symbol(const char *name) | |||
582 | { | 584 | { |
583 | struct symbol *sym; | 585 | struct symbol *sym; |
584 | 586 | ||
585 | sym = find_symbol(name, SYM_NORMAL); | 587 | sym = find_symbol(name, SYM_NORMAL, 0); |
586 | if (!sym) | 588 | if (!sym) |
587 | error_with_pos("export undefined symbol %s", name); | 589 | error_with_pos("export undefined symbol %s", name); |
588 | else { | 590 | else { |