aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-05-02 19:33:56 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-05-02 19:33:56 -0400
commit414772fa496273d1a93cefa6dab790f5fdf9de82 (patch)
treecdf96b513010ac6bfb02728bbb22906978af321c
parent7e567b44e6c59ad8bec321afb03302ffb1e6dda6 (diff)
parentb614a697dc17dff82f140d72d21a095f810fa7fb (diff)
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes
* 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes: kbuild, modpost: Check the section flags, to catch missing "ax"/"aw" kbuild: fix comment in modpost.c kbuild: fix scripts/setlocalversion with git kbuild: fix Module.markers permission error under cygwin docs: also clean index.html kbuild: remove a tag file before it is regenerated kbuild: "make prepare" should be "make modules_prepare" kbuild: clean Module.markers and modules.order for out-of-tree modules avr32: drop unused CLEAN_FILES
-rw-r--r--Documentation/DocBook/Makefile5
-rw-r--r--Makefile6
-rw-r--r--arch/avr32/Makefile2
-rw-r--r--scripts/mod/modpost.c55
-rwxr-xr-xscripts/setlocalversion13
-rwxr-xr-xscripts/tags.sh2
6 files changed, 36 insertions, 47 deletions
diff --git a/Documentation/DocBook/Makefile b/Documentation/DocBook/Makefile
index 8918a32c6b3a..b1eb661e6302 100644
--- a/Documentation/DocBook/Makefile
+++ b/Documentation/DocBook/Makefile
@@ -143,7 +143,8 @@ quiet_cmd_db2pdf = PDF $@
143 $(call cmd,db2pdf) 143 $(call cmd,db2pdf)
144 144
145 145
146main_idx = Documentation/DocBook/index.html 146index = index.html
147main_idx = Documentation/DocBook/$(index)
147build_main_index = rm -rf $(main_idx) && \ 148build_main_index = rm -rf $(main_idx) && \
148 echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \ 149 echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
149 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ 150 echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
@@ -232,7 +233,7 @@ clean-files := $(DOCBOOKS) \
232 $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \ 233 $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \
233 $(patsubst %.xml, %.html, $(DOCBOOKS)) \ 234 $(patsubst %.xml, %.html, $(DOCBOOKS)) \
234 $(patsubst %.xml, %.9, $(DOCBOOKS)) \ 235 $(patsubst %.xml, %.9, $(DOCBOOKS)) \
235 $(C-procfs-example) 236 $(C-procfs-example) $(index)
236 237
237clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man 238clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
238 239
diff --git a/Makefile b/Makefile
index eb38c8399261..b18afad2e100 100644
--- a/Makefile
+++ b/Makefile
@@ -1293,7 +1293,7 @@ help:
1293 @echo ' dir/ - Build all files in dir and below' 1293 @echo ' dir/ - Build all files in dir and below'
1294 @echo ' dir/file.[ois] - Build specified target only' 1294 @echo ' dir/file.[ois] - Build specified target only'
1295 @echo ' dir/file.ko - Build module including final link' 1295 @echo ' dir/file.ko - Build module including final link'
1296 @echo ' prepare - Set up for building external modules' 1296 @echo ' modules_prepare - Set up for building external modules'
1297 @echo ' tags/TAGS - Generate tags file for editors' 1297 @echo ' tags/TAGS - Generate tags file for editors'
1298 @echo ' cscope - Generate cscope index' 1298 @echo ' cscope - Generate cscope index'
1299 @echo ' kernelrelease - Output the release version string' 1299 @echo ' kernelrelease - Output the release version string'
@@ -1421,7 +1421,9 @@ $(clean-dirs):
1421 $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) 1421 $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
1422 1422
1423clean: rm-dirs := $(MODVERDIR) 1423clean: rm-dirs := $(MODVERDIR)
1424clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers 1424clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \
1425 $(KBUILD_EXTMOD)/Module.markers \
1426 $(KBUILD_EXTMOD)/modules.order
1425clean: $(clean-dirs) 1427clean: $(clean-dirs)
1426 $(call cmd,rmdirs) 1428 $(call cmd,rmdirs)
1427 $(call cmd,rmfiles) 1429 $(call cmd,rmfiles)
diff --git a/arch/avr32/Makefile b/arch/avr32/Makefile
index 0b97e14f73f6..c21a3290d542 100644
--- a/arch/avr32/Makefile
+++ b/arch/avr32/Makefile
@@ -43,8 +43,6 @@ core-y += arch/avr32/mm/
43drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/ 43drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/
44libs-y += arch/avr32/lib/ 44libs-y += arch/avr32/lib/
45 45
46CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
47
48BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec 46BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
49 47
50.PHONY: $(BOOT_TARGETS) install 48.PHONY: $(BOOT_TARGETS) install
diff --git a/scripts/mod/modpost.c b/scripts/mod/modpost.c
index 8d46ea7d6715..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 */
718static const char *section_white_list[] = 718static 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 */
732static int check_section(const char *modname, const char *sec) 726static 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
@@ -928,8 +914,7 @@ static int section_mismatch(const char *fromsec, const char *tosec)
928 * *probe_one, *_console, *_timer 914 * *probe_one, *_console, *_timer
929 * 915 *
930 * Pattern 3: 916 * Pattern 3:
931 * Whitelist all refereces from .text.head to .init.data 917 * Whitelist all references from .head.text to any init section
932 * Whitelist all refereces from .text.head to .init.text
933 * 918 *
934 * Pattern 4: 919 * Pattern 4:
935 * 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
@@ -1359,7 +1344,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
1359 fromsec = sech_name(elf, sechdr); 1344 fromsec = sech_name(elf, sechdr);
1360 fromsec += strlen(".rela"); 1345 fromsec += strlen(".rela");
1361 /* if from section (name) is know good then skip it */ 1346 /* if from section (name) is know good then skip it */
1362 if (check_section(modname, fromsec)) 1347 if (match(fromsec, section_white_list))
1363 return; 1348 return;
1364 1349
1365 for (rela = start; rela < stop; rela++) { 1350 for (rela = start; rela < stop; rela++) {
@@ -1403,7 +1388,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
1403 fromsec = sech_name(elf, sechdr); 1388 fromsec = sech_name(elf, sechdr);
1404 fromsec += strlen(".rel"); 1389 fromsec += strlen(".rel");
1405 /* if from section (name) is know good then skip it */ 1390 /* if from section (name) is know good then skip it */
1406 if (check_section(modname, fromsec)) 1391 if (match(fromsec, section_white_list))
1407 return; 1392 return;
1408 1393
1409 for (rel = start; rel < stop; rel++) { 1394 for (rel = start; rel < stop; rel++) {
@@ -1466,6 +1451,7 @@ static void check_sec_ref(struct module *mod, const char *modname,
1466 1451
1467 /* Walk through all sections */ 1452 /* Walk through all sections */
1468 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]);
1469 /* We want to process only relocation sections and not .init */ 1455 /* We want to process only relocation sections and not .init */
1470 if (sechdrs[i].sh_type == SHT_RELA) 1456 if (sechdrs[i].sh_type == SHT_RELA)
1471 section_rela(modname, elf, &elf->sechdrs[i]); 1457 section_rela(modname, elf, &elf->sechdrs[i]);
@@ -1990,6 +1976,7 @@ static void read_markers(const char *fname)
1990 if (!mod->skip) 1976 if (!mod->skip)
1991 add_marker(mod, marker, fmt); 1977 add_marker(mod, marker, fmt);
1992 } 1978 }
1979 release_file(file, size);
1993 return; 1980 return;
1994fail: 1981fail:
1995 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.
12if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then 12if 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 ;;
173esac 175esac