diff options
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 59 |
1 files changed, 18 insertions, 41 deletions
@@ -610,25 +610,20 @@ export INSTALL_PATH ?= /boot | |||
610 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) | 610 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
611 | export MODLIB | 611 | export MODLIB |
612 | 612 | ||
613 | strip-symbols := $(srctree)/scripts/strip-symbols \ | ||
614 | $(wildcard $(srctree)/arch/$(ARCH)/scripts/strip-symbols) | ||
615 | |||
616 | # | 613 | # |
617 | # INSTALL_MOD_STRIP, if defined, will cause modules to be stripped while | 614 | # INSTALL_MOD_STRIP, if defined, will cause modules to be |
618 | # they get installed. If INSTALL_MOD_STRIP is '1', then the default | 615 | # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then |
619 | # options (see below) will be used. Otherwise, INSTALL_MOD_STRIP will | 616 | # the default option --strip-debug will be used. Otherwise, |
620 | # be used as the option(s) to the objcopy command. | 617 | # INSTALL_MOD_STRIP will used as the options to the strip command. |
618 | |||
621 | ifdef INSTALL_MOD_STRIP | 619 | ifdef INSTALL_MOD_STRIP |
622 | ifeq ($(INSTALL_MOD_STRIP),1) | 620 | ifeq ($(INSTALL_MOD_STRIP),1) |
623 | mod_strip_cmd = $(OBJCOPY) --strip-debug | 621 | mod_strip_cmd = $(STRIP) --strip-debug |
624 | ifeq ($(CONFIG_KALLSYMS_ALL),$(CONFIG_KALLSYMS_STRIP_GENERATED)) | ||
625 | mod_strip_cmd += --wildcard $(addprefix --strip-symbols ,$(strip-symbols)) | ||
626 | endif | ||
627 | else | 622 | else |
628 | mod_strip_cmd = $(OBJCOPY) $(INSTALL_MOD_STRIP) | 623 | mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) |
629 | endif # INSTALL_MOD_STRIP=1 | 624 | endif # INSTALL_MOD_STRIP=1 |
630 | else | 625 | else |
631 | mod_strip_cmd = false | 626 | mod_strip_cmd = true |
632 | endif # INSTALL_MOD_STRIP | 627 | endif # INSTALL_MOD_STRIP |
633 | export mod_strip_cmd | 628 | export mod_strip_cmd |
634 | 629 | ||
@@ -758,7 +753,6 @@ last_kallsyms := 2 | |||
758 | endif | 753 | endif |
759 | 754 | ||
760 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o | 755 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o |
761 | kallsyms.h := $(wildcard include/config/kallsyms/*.h) $(wildcard include/config/kallsyms/*/*.h) | ||
762 | 756 | ||
763 | define verify_kallsyms | 757 | define verify_kallsyms |
764 | $(Q)$(if $($(quiet)cmd_sysmap), \ | 758 | $(Q)$(if $($(quiet)cmd_sysmap), \ |
@@ -783,41 +777,24 @@ endef | |||
783 | 777 | ||
784 | # Generate .S file with all kernel symbols | 778 | # Generate .S file with all kernel symbols |
785 | quiet_cmd_kallsyms = KSYM $@ | 779 | quiet_cmd_kallsyms = KSYM $@ |
786 | cmd_kallsyms = { test $* -eq 0 || $(NM) -n $<; } \ | 780 | cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \ |
787 | | $(KALLSYMS) $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) >$@ | 781 | $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ |
788 | |||
789 | quiet_cmd_kstrip = STRIP $@ | ||
790 | cmd_kstrip = $(OBJCOPY) --wildcard $(addprefix --strip$(if $(CONFIG_RELOCATABLE),-unneeded)-symbols ,$(filter %/scripts/strip-symbols,$^)) $< $@ | ||
791 | 782 | ||
792 | $(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): KBUILD_AFLAGS += -Wa,--strip-local-absolute | 783 | .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE |
793 | $(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): %.o: %.S scripts FORCE | ||
794 | $(call if_changed_dep,as_o_S) | 784 | $(call if_changed_dep,as_o_S) |
795 | 785 | ||
796 | ifeq ($(CONFIG_KALLSYMS_STRIP_GENERATED),y) | 786 | .tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) |
797 | strip-ext := .stripped | ||
798 | endif | ||
799 | |||
800 | .tmp_kallsyms%.S: .tmp_vmlinux%$(strip-ext) $(KALLSYMS) $(kallsyms.h) | ||
801 | $(call cmd,kallsyms) | 787 | $(call cmd,kallsyms) |
802 | 788 | ||
803 | # make -jN seems to have problems with intermediate files, see bug #3330. | ||
804 | .SECONDARY: $(foreach n,1 2 3,.tmp_vmlinux$(n).stripped) | ||
805 | .tmp_vmlinux%.stripped: .tmp_vmlinux% $(strip-symbols) $(kallsyms.h) | ||
806 | $(call cmd,kstrip) | ||
807 | |||
808 | ifneq ($(CONFIG_DEBUG_INFO),y) | ||
809 | .tmp_vmlinux%: LDFLAGS_vmlinux += -S | ||
810 | endif | ||
811 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version | 789 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version |
812 | .tmp_vmlinux%: $(vmlinux-lds) $(vmlinux-all) FORCE | 790 | .tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE |
813 | $(if $(filter 1,$*),$(call if_changed_rule,ksym_ld),$(call if_changed,vmlinux__)) | 791 | $(call if_changed_rule,ksym_ld) |
814 | 792 | ||
815 | .tmp_vmlinux0$(strip-ext): | 793 | .tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE |
816 | $(Q)echo "placeholder" >$@ | 794 | $(call if_changed,vmlinux__) |
817 | 795 | ||
818 | .tmp_vmlinux1: .tmp_kallsyms0.o | 796 | .tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE |
819 | .tmp_vmlinux2: .tmp_kallsyms1.o | 797 | $(call if_changed,vmlinux__) |
820 | .tmp_vmlinux3: .tmp_kallsyms2.o | ||
821 | 798 | ||
822 | # Needs to visit scripts/ before $(KALLSYMS) can be used. | 799 | # Needs to visit scripts/ before $(KALLSYMS) can be used. |
823 | $(KALLSYMS): scripts ; | 800 | $(KALLSYMS): scripts ; |