diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/basic/fixdep.c | 10 | ||||
-rwxr-xr-x | scripts/kernel-doc | 6 | ||||
-rw-r--r-- | scripts/mod/file2alias.c | 22 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 39 |
4 files changed, 62 insertions, 15 deletions
diff --git a/scripts/basic/fixdep.c b/scripts/basic/fixdep.c index 668a11a8b383..6bc7e7cfccf6 100644 --- a/scripts/basic/fixdep.c +++ b/scripts/basic/fixdep.c | |||
@@ -28,9 +28,11 @@ | |||
28 | * the dependency on linux/autoconf.h by a dependency on every config | 28 | * the dependency on linux/autoconf.h by a dependency on every config |
29 | * option which is mentioned in any of the listed prequisites. | 29 | * option which is mentioned in any of the listed prequisites. |
30 | * | 30 | * |
31 | * To be exact, split-include populates a tree in include/config/, | 31 | * kconfig populates a tree in include/config/ with an empty file |
32 | * e.g. include/config/his/driver.h, which contains the #define/#undef | 32 | * for each config symbol and when the configuration is updated |
33 | * for the CONFIG_HIS_DRIVER option. | 33 | * the files representing changed config options are touched |
34 | * which then let make pick up the changes and the files that use | ||
35 | * the config symbols are rebuilt. | ||
34 | * | 36 | * |
35 | * So if the user changes his CONFIG_HIS_DRIVER option, only the objects | 37 | * So if the user changes his CONFIG_HIS_DRIVER option, only the objects |
36 | * which depend on "include/linux/config/his/driver.h" will be rebuilt, | 38 | * which depend on "include/linux/config/his/driver.h" will be rebuilt, |
@@ -245,6 +247,8 @@ void parse_config_file(char *map, size_t len) | |||
245 | continue; | 247 | continue; |
246 | 248 | ||
247 | found: | 249 | found: |
250 | if (!memcmp(q - 7, "_MODULE", 7)) | ||
251 | q -= 7; | ||
248 | use_config(p+7, q-p-7); | 252 | use_config(p+7, q-p-7); |
249 | } | 253 | } |
250 | } | 254 | } |
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 4d928b859845..8be269ffbf9d 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -452,7 +452,7 @@ sub output_struct_html(%) { | |||
452 | my %args = %{$_[0]}; | 452 | my %args = %{$_[0]}; |
453 | my ($parameter); | 453 | my ($parameter); |
454 | 454 | ||
455 | print "<h2>".$args{'type'}." ".$args{'struct'}."</h2>\n"; | 455 | print "<h2>".$args{'type'}." ".$args{'struct'}. " - " .$args{'purpose'}."</h2>\n"; |
456 | print "<b>".$args{'type'}." ".$args{'struct'}."</b> {<br>\n"; | 456 | print "<b>".$args{'type'}." ".$args{'struct'}."</b> {<br>\n"; |
457 | foreach $parameter (@{$args{'parameterlist'}}) { | 457 | foreach $parameter (@{$args{'parameterlist'}}) { |
458 | if ($parameter =~ /^#/) { | 458 | if ($parameter =~ /^#/) { |
@@ -498,8 +498,8 @@ sub output_function_html(%) { | |||
498 | my %args = %{$_[0]}; | 498 | my %args = %{$_[0]}; |
499 | my ($parameter, $section); | 499 | my ($parameter, $section); |
500 | my $count; | 500 | my $count; |
501 | print "<h2>Function</h2>\n"; | ||
502 | 501 | ||
502 | print "<h2>" .$args{'function'}." - ".$args{'purpose'}."</h2>\n"; | ||
503 | print "<i>".$args{'functiontype'}."</i>\n"; | 503 | print "<i>".$args{'functiontype'}."</i>\n"; |
504 | print "<b>".$args{'function'}."</b>\n"; | 504 | print "<b>".$args{'function'}."</b>\n"; |
505 | print "("; | 505 | print "("; |
@@ -1547,7 +1547,7 @@ sub dump_function($$) { | |||
1547 | $prototype =~ s/^noinline +//; | 1547 | $prototype =~ s/^noinline +//; |
1548 | $prototype =~ s/__devinit +//; | 1548 | $prototype =~ s/__devinit +//; |
1549 | $prototype =~ s/^#define\s+//; #ak added | 1549 | $prototype =~ s/^#define\s+//; #ak added |
1550 | $prototype =~ s/__attribute__ \(\([a-z,]*\)\)//; | 1550 | $prototype =~ s/__attribute__\s*\(\([a-z,]*\)\)//; |
1551 | 1551 | ||
1552 | # Yes, this truly is vile. We are looking for: | 1552 | # Yes, this truly is vile. We are looking for: |
1553 | # 1. Return type (may be nothing if we're looking at a macro) | 1553 | # 1. Return type (may be nothing if we're looking at a macro) |
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c index f61c9ccef6aa..b2f73ffb40bd 100644 --- a/scripts/mod/file2alias.c +++ b/scripts/mod/file2alias.c | |||
@@ -452,6 +452,24 @@ static int do_eisa_entry(const char *filename, struct eisa_device_id *eisa, | |||
452 | return 1; | 452 | return 1; |
453 | } | 453 | } |
454 | 454 | ||
455 | /* Looks like: parisc:tNhvNrevNsvN */ | ||
456 | static int do_parisc_entry(const char *filename, struct parisc_device_id *id, | ||
457 | char *alias) | ||
458 | { | ||
459 | id->hw_type = TO_NATIVE(id->hw_type); | ||
460 | id->hversion = TO_NATIVE(id->hversion); | ||
461 | id->hversion_rev = TO_NATIVE(id->hversion_rev); | ||
462 | id->sversion = TO_NATIVE(id->sversion); | ||
463 | |||
464 | strcpy(alias, "parisc:"); | ||
465 | ADD(alias, "t", id->hw_type != PA_HWTYPE_ANY_ID, id->hw_type); | ||
466 | ADD(alias, "hv", id->hversion != PA_HVERSION_ANY_ID, id->hversion); | ||
467 | ADD(alias, "rev", id->hversion_rev != PA_HVERSION_REV_ANY_ID, id->hversion_rev); | ||
468 | ADD(alias, "sv", id->sversion != PA_SVERSION_ANY_ID, id->sversion); | ||
469 | |||
470 | return 1; | ||
471 | } | ||
472 | |||
455 | /* Ignore any prefix, eg. v850 prepends _ */ | 473 | /* Ignore any prefix, eg. v850 prepends _ */ |
456 | static inline int sym_is(const char *symbol, const char *name) | 474 | static inline int sym_is(const char *symbol, const char *name) |
457 | { | 475 | { |
@@ -559,6 +577,10 @@ void handle_moddevtable(struct module *mod, struct elf_info *info, | |||
559 | do_table(symval, sym->st_size, | 577 | do_table(symval, sym->st_size, |
560 | sizeof(struct eisa_device_id), "eisa", | 578 | sizeof(struct eisa_device_id), "eisa", |
561 | do_eisa_entry, mod); | 579 | do_eisa_entry, mod); |
580 | else if (sym_is(symname, "__mod_parisc_device_table")) | ||
581 | do_table(symval, sym->st_size, | ||
582 | sizeof(struct parisc_device_id), "parisc", | ||
583 | do_parisc_entry, mod); | ||
562 | } | 584 | } |
563 | 585 | ||
564 | /* Now add out buffered information to the generated C source */ | 586 | /* Now add out buffered information to the generated C source */ |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index 569e68410d7a..65bdfdb56877 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -686,6 +686,30 @@ static Elf_Sym *find_elf_symbol(struct elf_info *elf, Elf_Addr addr, | |||
686 | return NULL; | 686 | return NULL; |
687 | } | 687 | } |
688 | 688 | ||
689 | static inline int is_arm_mapping_symbol(const char *str) | ||
690 | { | ||
691 | return str[0] == '$' && strchr("atd", str[1]) | ||
692 | && (str[2] == '\0' || str[2] == '.'); | ||
693 | } | ||
694 | |||
695 | /* | ||
696 | * If there's no name there, ignore it; likewise, ignore it if it's | ||
697 | * one of the magic symbols emitted used by current ARM tools. | ||
698 | * | ||
699 | * Otherwise if find_symbols_between() returns those symbols, they'll | ||
700 | * fail the whitelist tests and cause lots of false alarms ... fixable | ||
701 | * only by merging __exit and __init sections into __text, bloating | ||
702 | * the kernel (which is especially evil on embedded platforms). | ||
703 | */ | ||
704 | static inline int is_valid_name(struct elf_info *elf, Elf_Sym *sym) | ||
705 | { | ||
706 | const char *name = elf->strtab + sym->st_name; | ||
707 | |||
708 | if (!name || !strlen(name)) | ||
709 | return 0; | ||
710 | return !is_arm_mapping_symbol(name); | ||
711 | } | ||
712 | |||
689 | /* | 713 | /* |
690 | * Find symbols before or equal addr and after addr - in the section sec. | 714 | * Find symbols before or equal addr and after addr - in the section sec. |
691 | * If we find two symbols with equal offset prefer one with a valid name. | 715 | * If we find two symbols with equal offset prefer one with a valid name. |
@@ -714,16 +738,15 @@ static void find_symbols_between(struct elf_info *elf, Elf_Addr addr, | |||
714 | symsec = secstrings + elf->sechdrs[sym->st_shndx].sh_name; | 738 | symsec = secstrings + elf->sechdrs[sym->st_shndx].sh_name; |
715 | if (strcmp(symsec, sec) != 0) | 739 | if (strcmp(symsec, sec) != 0) |
716 | continue; | 740 | continue; |
741 | if (!is_valid_name(elf, sym)) | ||
742 | continue; | ||
717 | if (sym->st_value <= addr) { | 743 | if (sym->st_value <= addr) { |
718 | if ((addr - sym->st_value) < beforediff) { | 744 | if ((addr - sym->st_value) < beforediff) { |
719 | beforediff = addr - sym->st_value; | 745 | beforediff = addr - sym->st_value; |
720 | *before = sym; | 746 | *before = sym; |
721 | } | 747 | } |
722 | else if ((addr - sym->st_value) == beforediff) { | 748 | else if ((addr - sym->st_value) == beforediff) { |
723 | /* equal offset, valid name? */ | 749 | *before = sym; |
724 | const char *name = elf->strtab + sym->st_name; | ||
725 | if (name && strlen(name)) | ||
726 | *before = sym; | ||
727 | } | 750 | } |
728 | } | 751 | } |
729 | else | 752 | else |
@@ -733,10 +756,7 @@ static void find_symbols_between(struct elf_info *elf, Elf_Addr addr, | |||
733 | *after = sym; | 756 | *after = sym; |
734 | } | 757 | } |
735 | else if ((sym->st_value - addr) == afterdiff) { | 758 | else if ((sym->st_value - addr) == afterdiff) { |
736 | /* equal offset, valid name? */ | 759 | *after = sym; |
737 | const char *name = elf->strtab + sym->st_name; | ||
738 | if (name && strlen(name)) | ||
739 | *after = sym; | ||
740 | } | 760 | } |
741 | } | 761 | } |
742 | } | 762 | } |
@@ -941,7 +961,7 @@ static int init_section_ref_ok(const char *name) | |||
941 | ".opd", /* see comment [OPD] at exit_section_ref_ok() */ | 961 | ".opd", /* see comment [OPD] at exit_section_ref_ok() */ |
942 | ".toc1", /* used by ppc64 */ | 962 | ".toc1", /* used by ppc64 */ |
943 | ".stab", | 963 | ".stab", |
944 | ".rodata", | 964 | ".data.rel.ro", /* used by parisc64 */ |
945 | ".parainstructions", | 965 | ".parainstructions", |
946 | ".text.lock", | 966 | ".text.lock", |
947 | "__bug_table", /* used by powerpc for BUG() */ | 967 | "__bug_table", /* used by powerpc for BUG() */ |
@@ -964,6 +984,7 @@ static int init_section_ref_ok(const char *name) | |||
964 | ".eh_frame", | 984 | ".eh_frame", |
965 | ".debug", | 985 | ".debug", |
966 | ".parainstructions", | 986 | ".parainstructions", |
987 | ".rodata", | ||
967 | NULL | 988 | NULL |
968 | }; | 989 | }; |
969 | /* part of section name */ | 990 | /* part of section name */ |