diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/Makefile.build | 3 | ||||
-rw-r--r-- | scripts/Makefile.lib | 9 | ||||
-rwxr-xr-x | scripts/kernel-doc | 7 | ||||
-rw-r--r-- | scripts/mod/modpost.c | 73 | ||||
-rwxr-xr-x | scripts/setlocalversion | 13 | ||||
-rwxr-xr-x | scripts/tags.sh | 2 |
6 files changed, 43 insertions, 64 deletions
diff --git a/scripts/Makefile.build b/scripts/Makefile.build index 39a9642927d3..5c4b7a400c18 100644 --- a/scripts/Makefile.build +++ b/scripts/Makefile.build | |||
@@ -27,6 +27,9 @@ ccflags-y := | |||
27 | cppflags-y := | 27 | cppflags-y := |
28 | ldflags-y := | 28 | ldflags-y := |
29 | 29 | ||
30 | subdir-asflags-y := | ||
31 | subdir-ccflags-y := | ||
32 | |||
30 | # Read auto.conf if it exists, otherwise ignore | 33 | # Read auto.conf if it exists, otherwise ignore |
31 | -include include/config/auto.conf | 34 | -include include/config/auto.conf |
32 | 35 | ||
diff --git a/scripts/Makefile.lib b/scripts/Makefile.lib index 979619574f70..cba61ca403ca 100644 --- a/scripts/Makefile.lib +++ b/scripts/Makefile.lib | |||
@@ -4,6 +4,11 @@ ccflags-y += $(EXTRA_CFLAGS) | |||
4 | cppflags-y += $(EXTRA_CPPFLAGS) | 4 | cppflags-y += $(EXTRA_CPPFLAGS) |
5 | ldflags-y += $(EXTRA_LDFLAGS) | 5 | ldflags-y += $(EXTRA_LDFLAGS) |
6 | 6 | ||
7 | # | ||
8 | # flags that take effect in sub directories | ||
9 | export KBUILD_SUBDIR_ASFLAGS := $(KBUILD_SUBDIR_ASFLAGS) $(subdir-asflags-y) | ||
10 | export KBUILD_SUBDIR_CCFLAGS := $(KBUILD_SUBDIR_CCFLAGS) $(subdir-ccflags-y) | ||
11 | |||
7 | # Figure out what we need to build from the various variables | 12 | # Figure out what we need to build from the various variables |
8 | # =========================================================================== | 13 | # =========================================================================== |
9 | 14 | ||
@@ -104,10 +109,10 @@ else | |||
104 | debug_flags = | 109 | debug_flags = |
105 | endif | 110 | endif |
106 | 111 | ||
107 | orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) \ | 112 | orig_c_flags = $(KBUILD_CPPFLAGS) $(KBUILD_CFLAGS) $(KBUILD_SUBDIR_CCFLAGS) \ |
108 | $(ccflags-y) $(CFLAGS_$(basetarget).o) | 113 | $(ccflags-y) $(CFLAGS_$(basetarget).o) |
109 | _c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) | 114 | _c_flags = $(filter-out $(CFLAGS_REMOVE_$(basetarget).o), $(orig_c_flags)) |
110 | _a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) \ | 115 | _a_flags = $(KBUILD_CPPFLAGS) $(KBUILD_AFLAGS) $(KBUILD_SUBDIR_ASFLAGS) \ |
111 | $(asflags-y) $(AFLAGS_$(basetarget).o) | 116 | $(asflags-y) $(AFLAGS_$(basetarget).o) |
112 | _cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) | 117 | _cpp_flags = $(KBUILD_CPPFLAGS) $(cppflags-y) $(CPPFLAGS_$(@F)) |
113 | 118 | ||
diff --git a/scripts/kernel-doc b/scripts/kernel-doc index 0f11870116dc..3208a3a7e7fe 100755 --- a/scripts/kernel-doc +++ b/scripts/kernel-doc | |||
@@ -1411,7 +1411,8 @@ sub dump_struct($$) { | |||
1411 | my $file = shift; | 1411 | my $file = shift; |
1412 | my $nested; | 1412 | my $nested; |
1413 | 1413 | ||
1414 | if ($x =~/(struct|union)\s+(\w+)\s*{(.*)}/) { | 1414 | if ($x =~ /(struct|union)\s+(\w+)\s*{(.*)}/) { |
1415 | #my $decl_type = $1; | ||
1415 | $declaration_name = $2; | 1416 | $declaration_name = $2; |
1416 | my $members = $3; | 1417 | my $members = $3; |
1417 | 1418 | ||
@@ -1420,8 +1421,8 @@ sub dump_struct($$) { | |||
1420 | $nested = $1; | 1421 | $nested = $1; |
1421 | 1422 | ||
1422 | # ignore members marked private: | 1423 | # ignore members marked private: |
1423 | $members =~ s/\/\*.*?private:.*?public:.*?\*\///gos; | 1424 | $members =~ s/\/\*\s*private:.*?\/\*\s*public:.*?\*\///gos; |
1424 | $members =~ s/\/\*.*?private:.*//gos; | 1425 | $members =~ s/\/\*\s*private:.*//gos; |
1425 | # strip comments: | 1426 | # strip comments: |
1426 | $members =~ s/\/\*.*?\*\///gos; | 1427 | $members =~ s/\/\*.*?\*\///gos; |
1427 | $nested =~ s/\/\*.*?\*\///gos; | 1428 | $nested =~ s/\/\*.*?\*\///gos; |
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c index df6e6286a065..936b6f8e46ff 100644 --- a/scripts/mod/modpost.c +++ b/scripts/mod/modpost.c | |||
@@ -716,41 +716,27 @@ int match(const char *sym, const char * const pat[]) | |||
716 | 716 | ||
717 | /* sections that we do not want to do full section mismatch check on */ | 717 | /* sections that we do not want to do full section mismatch check on */ |
718 | static const char *section_white_list[] = | 718 | static const char *section_white_list[] = |
719 | { ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL }; | 719 | { ".comment", ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL }; |
720 | 720 | ||
721 | /* | 721 | /* |
722 | * Is this section one we do not want to check? | 722 | * This is used to find sections missing the SHF_ALLOC flag. |
723 | * This is often debug sections. | ||
724 | * If we are going to check this section then | ||
725 | * test if section name ends with a dot and a number. | ||
726 | * This is used to find sections where the linker have | ||
727 | * appended a dot-number to make the name unique. | ||
728 | * The cause of this is often a section specified in assembler | 723 | * The cause of this is often a section specified in assembler |
729 | * without "ax" / "aw" and the same section used in .c | 724 | * without "ax" / "aw". |
730 | * code where gcc add these. | ||
731 | */ | 725 | */ |
732 | static int check_section(const char *modname, const char *sec) | 726 | static void check_section(const char *modname, struct elf_info *elf, |
733 | { | 727 | Elf_Shdr *sechdr) |
734 | const char *e = sec + strlen(sec) - 1; | 728 | { |
735 | if (match(sec, section_white_list)) | 729 | const char *sec = sech_name(elf, sechdr); |
736 | return 1; | 730 | |
737 | 731 | if (sechdr->sh_type == SHT_PROGBITS && | |
738 | if (*e && isdigit(*e)) { | 732 | !(sechdr->sh_flags & SHF_ALLOC) && |
739 | /* consume all digits */ | 733 | !match(sec, section_white_list)) { |
740 | while (*e && e != sec && isdigit(*e)) | 734 | warn("%s (%s): unexpected non-allocatable section.\n" |
741 | e--; | 735 | "Did you forget to use \"ax\"/\"aw\" in a .S file?\n" |
742 | if (*e == '.' && !strstr(sec, ".linkonce")) { | 736 | "Note that for example <linux/init.h> contains\n" |
743 | warn("%s (%s): unexpected section name.\n" | 737 | "section definitions for use in .S files.\n\n", |
744 | "The (.[number]+) following section name are " | 738 | modname, sec); |
745 | "ld generated and not expected.\n" | ||
746 | "Did you forget to use \"ax\"/\"aw\" " | ||
747 | "in a .S file?\n" | ||
748 | "Note that for example <linux/init.h> contains\n" | ||
749 | "section definitions for use in .S files.\n\n", | ||
750 | modname, sec); | ||
751 | } | ||
752 | } | 739 | } |
753 | return 0; | ||
754 | } | 740 | } |
755 | 741 | ||
756 | 742 | ||
@@ -794,15 +780,6 @@ static const char *init_exit_sections[] = | |||
794 | /* data section */ | 780 | /* data section */ |
795 | static const char *data_sections[] = { DATA_SECTIONS, NULL }; | 781 | static const char *data_sections[] = { DATA_SECTIONS, NULL }; |
796 | 782 | ||
797 | /* sections that may refer to an init/exit section with no warning */ | ||
798 | static const char *initref_sections[] = | ||
799 | { | ||
800 | ".text.init.refok*", | ||
801 | ".exit.text.refok*", | ||
802 | ".data.init.refok*", | ||
803 | NULL | ||
804 | }; | ||
805 | |||
806 | 783 | ||
807 | /* symbols in .data that may refer to init/exit sections */ | 784 | /* symbols in .data that may refer to init/exit sections */ |
808 | static const char *symbol_white_list[] = | 785 | static const char *symbol_white_list[] = |
@@ -915,11 +892,6 @@ static int section_mismatch(const char *fromsec, const char *tosec) | |||
915 | /** | 892 | /** |
916 | * Whitelist to allow certain references to pass with no warning. | 893 | * Whitelist to allow certain references to pass with no warning. |
917 | * | 894 | * |
918 | * Pattern 0: | ||
919 | * Do not warn if funtion/data are marked with __init_refok/__initdata_refok. | ||
920 | * The pattern is identified by: | ||
921 | * fromsec = .text.init.refok* | .data.init.refok* | ||
922 | * | ||
923 | * Pattern 1: | 895 | * Pattern 1: |
924 | * If a module parameter is declared __initdata and permissions=0 | 896 | * If a module parameter is declared __initdata and permissions=0 |
925 | * then this is legal despite the warning generated. | 897 | * then this is legal despite the warning generated. |
@@ -942,8 +914,7 @@ static int section_mismatch(const char *fromsec, const char *tosec) | |||
942 | * *probe_one, *_console, *_timer | 914 | * *probe_one, *_console, *_timer |
943 | * | 915 | * |
944 | * Pattern 3: | 916 | * Pattern 3: |
945 | * Whitelist all refereces from .text.head to .init.data | 917 | * Whitelist all references from .head.text to any init section |
946 | * Whitelist all refereces from .text.head to .init.text | ||
947 | * | 918 | * |
948 | * Pattern 4: | 919 | * Pattern 4: |
949 | * Some symbols belong to init section but still it is ok to reference | 920 | * Some symbols belong to init section but still it is ok to reference |
@@ -958,10 +929,6 @@ static int section_mismatch(const char *fromsec, const char *tosec) | |||
958 | static int secref_whitelist(const char *fromsec, const char *fromsym, | 929 | static int secref_whitelist(const char *fromsec, const char *fromsym, |
959 | const char *tosec, const char *tosym) | 930 | const char *tosec, const char *tosym) |
960 | { | 931 | { |
961 | /* Check for pattern 0 */ | ||
962 | if (match(fromsec, initref_sections)) | ||
963 | return 0; | ||
964 | |||
965 | /* Check for pattern 1 */ | 932 | /* Check for pattern 1 */ |
966 | if (match(tosec, init_data_sections) && | 933 | if (match(tosec, init_data_sections) && |
967 | match(fromsec, data_sections) && | 934 | match(fromsec, data_sections) && |
@@ -1377,7 +1344,7 @@ static void section_rela(const char *modname, struct elf_info *elf, | |||
1377 | fromsec = sech_name(elf, sechdr); | 1344 | fromsec = sech_name(elf, sechdr); |
1378 | fromsec += strlen(".rela"); | 1345 | fromsec += strlen(".rela"); |
1379 | /* if from section (name) is know good then skip it */ | 1346 | /* if from section (name) is know good then skip it */ |
1380 | if (check_section(modname, fromsec)) | 1347 | if (match(fromsec, section_white_list)) |
1381 | return; | 1348 | return; |
1382 | 1349 | ||
1383 | for (rela = start; rela < stop; rela++) { | 1350 | for (rela = start; rela < stop; rela++) { |
@@ -1421,7 +1388,7 @@ static void section_rel(const char *modname, struct elf_info *elf, | |||
1421 | fromsec = sech_name(elf, sechdr); | 1388 | fromsec = sech_name(elf, sechdr); |
1422 | fromsec += strlen(".rel"); | 1389 | fromsec += strlen(".rel"); |
1423 | /* if from section (name) is know good then skip it */ | 1390 | /* if from section (name) is know good then skip it */ |
1424 | if (check_section(modname, fromsec)) | 1391 | if (match(fromsec, section_white_list)) |
1425 | return; | 1392 | return; |
1426 | 1393 | ||
1427 | for (rel = start; rel < stop; rel++) { | 1394 | for (rel = start; rel < stop; rel++) { |
@@ -1484,6 +1451,7 @@ static void check_sec_ref(struct module *mod, const char *modname, | |||
1484 | 1451 | ||
1485 | /* Walk through all sections */ | 1452 | /* Walk through all sections */ |
1486 | for (i = 0; i < elf->hdr->e_shnum; i++) { | 1453 | for (i = 0; i < elf->hdr->e_shnum; i++) { |
1454 | check_section(modname, elf, &elf->sechdrs[i]); | ||
1487 | /* We want to process only relocation sections and not .init */ | 1455 | /* We want to process only relocation sections and not .init */ |
1488 | if (sechdrs[i].sh_type == SHT_RELA) | 1456 | if (sechdrs[i].sh_type == SHT_RELA) |
1489 | section_rela(modname, elf, &elf->sechdrs[i]); | 1457 | section_rela(modname, elf, &elf->sechdrs[i]); |
@@ -2008,6 +1976,7 @@ static void read_markers(const char *fname) | |||
2008 | if (!mod->skip) | 1976 | if (!mod->skip) |
2009 | add_marker(mod, marker, fmt); | 1977 | add_marker(mod, marker, fmt); |
2010 | } | 1978 | } |
1979 | release_file(file, size); | ||
2011 | return; | 1980 | return; |
2012 | fail: | 1981 | fail: |
2013 | fatal("parse error in markers list file\n"); | 1982 | fatal("parse error in markers list file\n"); |
diff --git a/scripts/setlocalversion b/scripts/setlocalversion index 47e75b69a2e9..32c8554f3946 100755 --- a/scripts/setlocalversion +++ b/scripts/setlocalversion | |||
@@ -10,13 +10,12 @@ cd "${1:-.}" || usage | |||
10 | 10 | ||
11 | # Check for git and a git repo. | 11 | # Check for git and a git repo. |
12 | if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then | 12 | if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then |
13 | # Do we have an untagged version? | 13 | # Do we have an untagged tag? |
14 | if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then | 14 | if atag=`git describe 2>/dev/null`; then |
15 | if tag=`git describe 2>/dev/null`; then | 15 | echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' |
16 | echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' | 16 | # add -g${head}, if there is no usable tag |
17 | else | 17 | else |
18 | printf '%s%s' -g $head | 18 | printf '%s%s' -g $head |
19 | fi | ||
20 | fi | 19 | fi |
21 | 20 | ||
22 | # Is this git on svn? | 21 | # Is this git on svn? |
diff --git a/scripts/tags.sh b/scripts/tags.sh index 5bd8b1003d44..4a34ec591e8c 100755 --- a/scripts/tags.sh +++ b/scripts/tags.sh | |||
@@ -164,10 +164,12 @@ case "$1" in | |||
164 | ;; | 164 | ;; |
165 | 165 | ||
166 | "tags") | 166 | "tags") |
167 | rm -f tags | ||
167 | xtags ctags | 168 | xtags ctags |
168 | ;; | 169 | ;; |
169 | 170 | ||
170 | "TAGS") | 171 | "TAGS") |
172 | rm -f TAGS | ||
171 | xtags etags | 173 | xtags etags |
172 | ;; | 174 | ;; |
173 | esac | 175 | esac |