Commit 414772fa authored by Linus Torvalds's avatar Linus Torvalds

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
parents 7e567b44 b614a697
...@@ -143,7 +143,8 @@ quiet_cmd_db2pdf = PDF $@ ...@@ -143,7 +143,8 @@ quiet_cmd_db2pdf = PDF $@
$(call cmd,db2pdf) $(call cmd,db2pdf)
main_idx = Documentation/DocBook/index.html index = index.html
main_idx = Documentation/DocBook/$(index)
build_main_index = rm -rf $(main_idx) && \ build_main_index = rm -rf $(main_idx) && \
echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \ echo '<h1>Linux Kernel HTML Documentation</h1>' >> $(main_idx) && \
echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \ echo '<h2>Kernel Version: $(KERNELVERSION)</h2>' >> $(main_idx) && \
...@@ -232,7 +233,7 @@ clean-files := $(DOCBOOKS) \ ...@@ -232,7 +233,7 @@ clean-files := $(DOCBOOKS) \
$(patsubst %.xml, %.pdf, $(DOCBOOKS)) \ $(patsubst %.xml, %.pdf, $(DOCBOOKS)) \
$(patsubst %.xml, %.html, $(DOCBOOKS)) \ $(patsubst %.xml, %.html, $(DOCBOOKS)) \
$(patsubst %.xml, %.9, $(DOCBOOKS)) \ $(patsubst %.xml, %.9, $(DOCBOOKS)) \
$(C-procfs-example) $(C-procfs-example) $(index)
clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man clean-dirs := $(patsubst %.xml,%,$(DOCBOOKS)) man
......
...@@ -1293,7 +1293,7 @@ help: ...@@ -1293,7 +1293,7 @@ help:
@echo ' dir/ - Build all files in dir and below' @echo ' dir/ - Build all files in dir and below'
@echo ' dir/file.[ois] - Build specified target only' @echo ' dir/file.[ois] - Build specified target only'
@echo ' dir/file.ko - Build module including final link' @echo ' dir/file.ko - Build module including final link'
@echo ' prepare - Set up for building external modules' @echo ' modules_prepare - Set up for building external modules'
@echo ' tags/TAGS - Generate tags file for editors' @echo ' tags/TAGS - Generate tags file for editors'
@echo ' cscope - Generate cscope index' @echo ' cscope - Generate cscope index'
@echo ' kernelrelease - Output the release version string' @echo ' kernelrelease - Output the release version string'
...@@ -1421,7 +1421,9 @@ $(clean-dirs): ...@@ -1421,7 +1421,9 @@ $(clean-dirs):
$(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@) $(Q)$(MAKE) $(clean)=$(patsubst _clean_%,%,$@)
clean: rm-dirs := $(MODVERDIR) clean: rm-dirs := $(MODVERDIR)
clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers clean: rm-files := $(KBUILD_EXTMOD)/Module.symvers \
$(KBUILD_EXTMOD)/Module.markers \
$(KBUILD_EXTMOD)/modules.order
clean: $(clean-dirs) clean: $(clean-dirs)
$(call cmd,rmdirs) $(call cmd,rmdirs)
$(call cmd,rmfiles) $(call cmd,rmfiles)
......
...@@ -43,8 +43,6 @@ core-y += arch/avr32/mm/ ...@@ -43,8 +43,6 @@ core-y += arch/avr32/mm/
drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/ drivers-$(CONFIG_OPROFILE) += arch/avr32/oprofile/
libs-y += arch/avr32/lib/ libs-y += arch/avr32/lib/
CLEAN_FILES += include/asm-avr32/.arch include/asm-avr32/arch
BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec BOOT_TARGETS := vmlinux.elf vmlinux.bin uImage uImage.srec
.PHONY: $(BOOT_TARGETS) install .PHONY: $(BOOT_TARGETS) install
......
...@@ -716,41 +716,27 @@ int match(const char *sym, const char * const pat[]) ...@@ -716,41 +716,27 @@ int match(const char *sym, const char * const pat[])
/* sections that we do not want to do full section mismatch check on */ /* sections that we do not want to do full section mismatch check on */
static const char *section_white_list[] = static const char *section_white_list[] =
{ ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL }; { ".comment", ".debug*", ".stab*", ".note*", ".got*", ".toc*", NULL };
/* /*
* Is this section one we do not want to check? * This is used to find sections missing the SHF_ALLOC flag.
* This is often debug sections.
* If we are going to check this section then
* test if section name ends with a dot and a number.
* This is used to find sections where the linker have
* appended a dot-number to make the name unique.
* The cause of this is often a section specified in assembler * The cause of this is often a section specified in assembler
* without "ax" / "aw" and the same section used in .c * without "ax" / "aw".
* code where gcc add these.
*/ */
static int check_section(const char *modname, const char *sec) static void check_section(const char *modname, struct elf_info *elf,
{ Elf_Shdr *sechdr)
const char *e = sec + strlen(sec) - 1; {
if (match(sec, section_white_list)) const char *sec = sech_name(elf, sechdr);
return 1;
if (sechdr->sh_type == SHT_PROGBITS &&
if (*e && isdigit(*e)) { !(sechdr->sh_flags & SHF_ALLOC) &&
/* consume all digits */ !match(sec, section_white_list)) {
while (*e && e != sec && isdigit(*e)) warn("%s (%s): unexpected non-allocatable section.\n"
e--; "Did you forget to use \"ax\"/\"aw\" in a .S file?\n"
if (*e == '.' && !strstr(sec, ".linkonce")) { "Note that for example <linux/init.h> contains\n"
warn("%s (%s): unexpected section name.\n" "section definitions for use in .S files.\n\n",
"The (.[number]+) following section name are " modname, sec);
"ld generated and not expected.\n"
"Did you forget to use \"ax\"/\"aw\" "
"in a .S file?\n"
"Note that for example <linux/init.h> contains\n"
"section definitions for use in .S files.\n\n",
modname, sec);
}
} }
return 0;
} }
...@@ -928,8 +914,7 @@ static int section_mismatch(const char *fromsec, const char *tosec) ...@@ -928,8 +914,7 @@ static int section_mismatch(const char *fromsec, const char *tosec)
* *probe_one, *_console, *_timer * *probe_one, *_console, *_timer
* *
* Pattern 3: * Pattern 3:
* Whitelist all refereces from .text.head to .init.data * Whitelist all references from .head.text to any init section
* Whitelist all refereces from .text.head to .init.text
* *
* Pattern 4: * Pattern 4:
* Some symbols belong to init section but still it is ok to reference * 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,7 +1344,7 @@ static void section_rela(const char *modname, struct elf_info *elf,
fromsec = sech_name(elf, sechdr); fromsec = sech_name(elf, sechdr);
fromsec += strlen(".rela"); fromsec += strlen(".rela");
/* if from section (name) is know good then skip it */ /* if from section (name) is know good then skip it */
if (check_section(modname, fromsec)) if (match(fromsec, section_white_list))
return; return;
for (rela = start; rela < stop; rela++) { for (rela = start; rela < stop; rela++) {
...@@ -1403,7 +1388,7 @@ static void section_rel(const char *modname, struct elf_info *elf, ...@@ -1403,7 +1388,7 @@ static void section_rel(const char *modname, struct elf_info *elf,
fromsec = sech_name(elf, sechdr); fromsec = sech_name(elf, sechdr);
fromsec += strlen(".rel"); fromsec += strlen(".rel");
/* if from section (name) is know good then skip it */ /* if from section (name) is know good then skip it */
if (check_section(modname, fromsec)) if (match(fromsec, section_white_list))
return; return;
for (rel = start; rel < stop; rel++) { for (rel = start; rel < stop; rel++) {
...@@ -1466,6 +1451,7 @@ static void check_sec_ref(struct module *mod, const char *modname, ...@@ -1466,6 +1451,7 @@ static void check_sec_ref(struct module *mod, const char *modname,
/* Walk through all sections */ /* Walk through all sections */
for (i = 0; i < elf->hdr->e_shnum; i++) { for (i = 0; i < elf->hdr->e_shnum; i++) {
check_section(modname, elf, &elf->sechdrs[i]);
/* We want to process only relocation sections and not .init */ /* We want to process only relocation sections and not .init */
if (sechdrs[i].sh_type == SHT_RELA) if (sechdrs[i].sh_type == SHT_RELA)
section_rela(modname, elf, &elf->sechdrs[i]); section_rela(modname, elf, &elf->sechdrs[i]);
...@@ -1990,6 +1976,7 @@ static void read_markers(const char *fname) ...@@ -1990,6 +1976,7 @@ static void read_markers(const char *fname)
if (!mod->skip) if (!mod->skip)
add_marker(mod, marker, fmt); add_marker(mod, marker, fmt);
} }
release_file(file, size);
return; return;
fail: fail:
fatal("parse error in markers list file\n"); fatal("parse error in markers list file\n");
......
...@@ -10,13 +10,12 @@ cd "${1:-.}" || usage ...@@ -10,13 +10,12 @@ cd "${1:-.}" || usage
# Check for git and a git repo. # Check for git and a git repo.
if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then if head=`git rev-parse --verify --short HEAD 2>/dev/null`; then
# Do we have an untagged version? # Do we have an untagged tag?
if git name-rev --tags HEAD | grep -E '^HEAD[[:space:]]+(.*~[0-9]*|undefined)$' > /dev/null; then if atag=`git describe 2>/dev/null`; then
if tag=`git describe 2>/dev/null`; then echo "$atag" | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}'
echo $tag | awk -F- '{printf("-%05d-%s", $(NF-1),$(NF))}' # add -g${head}, if there is no usable tag
else else
printf '%s%s' -g $head printf '%s%s' -g $head
fi
fi fi
# Is this git on svn? # Is this git on svn?
......
...@@ -164,10 +164,12 @@ case "$1" in ...@@ -164,10 +164,12 @@ case "$1" in
;; ;;
"tags") "tags")
rm -f tags
xtags ctags xtags ctags
;; ;;
"TAGS") "TAGS")
rm -f TAGS
xtags etags xtags etags
;; ;;
esac esac
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment