aboutsummaryrefslogtreecommitdiffstats
path: root/Makefile
diff options
context:
space:
mode:
authorSam Ravnborg <sam@ravnborg.org>2007-07-17 04:54:06 -0400
committerSam Ravnborg <sam@ravnborg.org>2007-07-17 04:54:06 -0400
commit741f98fe298a73c9d47ed53703c1279a29718581 (patch)
tree2019e9c571c89e3101be86777d28f3ddeba67b79 /Makefile
parent1e29a706eef664f2c5014462d435f54a1952cc7b (diff)
kbuild: do section mismatch check on full vmlinux
Previously we did do the check on the .o files used to link vmlinux but that failed to find questionable references across the .o files. Create a dedicated vmlinux.o file used only for section mismatch checks that uses the defualt linker script so section does not get renamed. The vmlinux.o may later be used as part of the the final link of vmlinux but for now it is used fo section mismatch only. For a defconfig build this is instant but for an allyesconfig this add two minutes to a full build (that anyways takes ~2 hours). Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile22
1 files changed, 19 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index ddbfcac299c..4f0bd65a38d 100644
--- a/Makefile
+++ b/Makefile
@@ -612,7 +612,7 @@ quiet_cmd_vmlinux__ ?= LD $@
612 cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \ 612 cmd_vmlinux__ ?= $(LD) $(LDFLAGS) $(LDFLAGS_vmlinux) -o $@ \
613 -T $(vmlinux-lds) $(vmlinux-init) \ 613 -T $(vmlinux-lds) $(vmlinux-init) \
614 --start-group $(vmlinux-main) --end-group \ 614 --start-group $(vmlinux-main) --end-group \
615 $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) FORCE ,$^) 615 $(filter-out $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) vmlinux.o FORCE ,$^)
616 616
617# Generate new vmlinux version 617# Generate new vmlinux version
618quiet_cmd_vmlinux_version = GEN .version 618quiet_cmd_vmlinux_version = GEN .version
@@ -736,15 +736,31 @@ debug_kallsyms: .tmp_map$(last_kallsyms)
736 736
737endif # ifdef CONFIG_KALLSYMS 737endif # ifdef CONFIG_KALLSYMS
738 738
739# Do modpost on a prelinked vmlinux. The finally linked vmlinux has
740# relevant sections renamed as per the linker script.
741quiet_cmd_vmlinux-modpost = LD $@
742 cmd_vmlinux-modpost = $(LD) $(LDFLAGS) -r -o $@ \
743 $(vmlinux-init) --start-group $(vmlinux-main) --end-group \
744 $(filter-out $(vmlinux-init) $(vmlinux-main) $(vmlinux-lds) FORCE ,$^)
745define rule_vmlinux-modpost
746 :
747 +$(call cmd,vmlinux-modpost)
748 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
749 $(Q)echo 'cmd_$@ := $(cmd_vmlinux-modpost)' > $(dot-target).cmd
750endef
751
739# vmlinux image - including updated kernel symbols 752# vmlinux image - including updated kernel symbols
740vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE 753vmlinux: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) vmlinux.o FORCE
741ifdef CONFIG_HEADERS_CHECK 754ifdef CONFIG_HEADERS_CHECK
742 $(Q)$(MAKE) -f $(srctree)/Makefile headers_check 755 $(Q)$(MAKE) -f $(srctree)/Makefile headers_check
743endif 756endif
757 $(call vmlinux-modpost)
744 $(call if_changed_rule,vmlinux__) 758 $(call if_changed_rule,vmlinux__)
745 $(Q)$(MAKE) -f $(srctree)/scripts/Makefile.modpost $@
746 $(Q)rm -f .old_version 759 $(Q)rm -f .old_version
747 760
761vmlinux.o: $(vmlinux-lds) $(vmlinux-init) $(vmlinux-main) $(kallsyms.o) FORCE
762 $(call if_changed_rule,vmlinux-modpost)
763
748# The actual objects are generated when descending, 764# The actual objects are generated when descending,
749# make sure no implicit rule kicks in 765# make sure no implicit rule kicks in
750$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ; 766$(sort $(vmlinux-init) $(vmlinux-main)) $(vmlinux-lds): $(vmlinux-dirs) ;