diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2009-01-14 15:38:20 -0500 |
---|---|---|
committer | Sam Ravnborg <sam@ravnborg.org> | 2009-01-14 15:38:20 -0500 |
commit | 2ea038917bbdd51a7ae4a898c6a04641324dd033 (patch) | |
tree | 6a6f8b1db4d097d260449f88c267e39ab9d2bb3f /Makefile | |
parent | a6525042bfdfcab128bd91fad264de10fd24a55e (diff) |
Revert "kbuild: strip generated symbols from *.ko"
This reverts commit ad7a953c522ceb496611d127e51e278bfe0ff483.
And commit: ("allow stripping of generated symbols under CONFIG_KALLSYMS_ALL")
9bb482476c6c9d1ae033306440c51ceac93ea80c
These stripping patches has caused a set of issues:
1) People have reported compatibility issues with binutils due to
lack of support for `--strip-unneeded-symbols' with objcopy 2.15.92.0.2
Reported by: Wenji
2) ccache and distcc no longer works as expeced
Reported by: Ted, Roland, + others
3) The installed modules increased a lot in size
Reported by: Ted, Davej + others
Reported-by: Wenji Huang <wenji.huang@oracle.com>
Reported-by: "Theodore Ts'o" <tytso@mit.edu>
Reported-by: Dave Jones <davej@redhat.com>
Reported-by: Roland McGrath <roland@redhat.com>
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'Makefile')
-rw-r--r-- | Makefile | 59 |
1 files changed, 18 insertions, 41 deletions
@@ -606,25 +606,20 @@ export INSTALL_PATH ?= /boot | |||
606 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) | 606 | MODLIB = $(INSTALL_MOD_PATH)/lib/modules/$(KERNELRELEASE) |
607 | export MODLIB | 607 | export MODLIB |
608 | 608 | ||
609 | strip-symbols := $(srctree)/scripts/strip-symbols \ | ||
610 | $(wildcard $(srctree)/arch/$(ARCH)/scripts/strip-symbols) | ||
611 | |||
612 | # | 609 | # |
613 | # INSTALL_MOD_STRIP, if defined, will cause modules to be stripped while | 610 | # INSTALL_MOD_STRIP, if defined, will cause modules to be |
614 | # they get installed. If INSTALL_MOD_STRIP is '1', then the default | 611 | # stripped after they are installed. If INSTALL_MOD_STRIP is '1', then |
615 | # options (see below) will be used. Otherwise, INSTALL_MOD_STRIP will | 612 | # the default option --strip-debug will be used. Otherwise, |
616 | # be used as the option(s) to the objcopy command. | 613 | # INSTALL_MOD_STRIP will used as the options to the strip command. |
614 | |||
617 | ifdef INSTALL_MOD_STRIP | 615 | ifdef INSTALL_MOD_STRIP |
618 | ifeq ($(INSTALL_MOD_STRIP),1) | 616 | ifeq ($(INSTALL_MOD_STRIP),1) |
619 | mod_strip_cmd = $(OBJCOPY) --strip-debug | 617 | mod_strip_cmd = $(STRIP) --strip-debug |
620 | ifeq ($(CONFIG_KALLSYMS_ALL),$(CONFIG_KALLSYMS_STRIP_GENERATED)) | ||
621 | mod_strip_cmd += --wildcard $(addprefix --strip-symbols ,$(strip-symbols)) | ||
622 | endif | ||
623 | else | 618 | else |
624 | mod_strip_cmd = $(OBJCOPY) $(INSTALL_MOD_STRIP) | 619 | mod_strip_cmd = $(STRIP) $(INSTALL_MOD_STRIP) |
625 | endif # INSTALL_MOD_STRIP=1 | 620 | endif # INSTALL_MOD_STRIP=1 |
626 | else | 621 | else |
627 | mod_strip_cmd = false | 622 | mod_strip_cmd = true |
628 | endif # INSTALL_MOD_STRIP | 623 | endif # INSTALL_MOD_STRIP |
629 | export mod_strip_cmd | 624 | export mod_strip_cmd |
630 | 625 | ||
@@ -754,7 +749,6 @@ last_kallsyms := 2 | |||
754 | endif | 749 | endif |
755 | 750 | ||
756 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o | 751 | kallsyms.o := .tmp_kallsyms$(last_kallsyms).o |
757 | kallsyms.h := $(wildcard include/config/kallsyms/*.h) $(wildcard include/config/kallsyms/*/*.h) | ||
758 | 752 | ||
759 | define verify_kallsyms | 753 | define verify_kallsyms |
760 | $(Q)$(if $($(quiet)cmd_sysmap), \ | 754 | $(Q)$(if $($(quiet)cmd_sysmap), \ |
@@ -779,41 +773,24 @@ endef | |||
779 | 773 | ||
780 | # Generate .S file with all kernel symbols | 774 | # Generate .S file with all kernel symbols |
781 | quiet_cmd_kallsyms = KSYM $@ | 775 | quiet_cmd_kallsyms = KSYM $@ |
782 | cmd_kallsyms = { test $* -eq 0 || $(NM) -n $<; } \ | 776 | cmd_kallsyms = $(NM) -n $< | $(KALLSYMS) \ |
783 | | $(KALLSYMS) $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) >$@ | 777 | $(if $(CONFIG_KALLSYMS_ALL),--all-symbols) > $@ |
784 | |||
785 | quiet_cmd_kstrip = STRIP $@ | ||
786 | cmd_kstrip = $(OBJCOPY) --wildcard $(addprefix --strip$(if $(CONFIG_RELOCATABLE),-unneeded)-symbols ,$(filter %/scripts/strip-symbols,$^)) $< $@ | ||
787 | 778 | ||
788 | $(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): KBUILD_AFLAGS += -Wa,--strip-local-absolute | 779 | .tmp_kallsyms1.o .tmp_kallsyms2.o .tmp_kallsyms3.o: %.o: %.S scripts FORCE |
789 | $(foreach n,0 1 2 3,.tmp_kallsyms$(n).o): %.o: %.S scripts FORCE | ||
790 | $(call if_changed_dep,as_o_S) | 780 | $(call if_changed_dep,as_o_S) |
791 | 781 | ||
792 | ifeq ($(CONFIG_KALLSYMS_STRIP_GENERATED),y) | 782 | .tmp_kallsyms%.S: .tmp_vmlinux% $(KALLSYMS) |
793 | strip-ext := .stripped | ||
794 | endif | ||
795 | |||
796 | .tmp_kallsyms%.S: .tmp_vmlinux%$(strip-ext) $(KALLSYMS) $(kallsyms.h) | ||
797 | $(call cmd,kallsyms) | 783 | $(call cmd,kallsyms) |
798 | 784 | ||
799 | # make -jN seems to have problems with intermediate files, see bug #3330. | ||
800 | .SECONDARY: $(foreach n,1 2 3,.tmp_vmlinux$(n).stripped) | ||
801 | .tmp_vmlinux%.stripped: .tmp_vmlinux% $(strip-symbols) $(kallsyms.h) | ||
802 | $(call cmd,kstrip) | ||
803 | |||
804 | ifneq ($(CONFIG_DEBUG_INFO),y) | ||
805 | .tmp_vmlinux%: LDFLAGS_vmlinux += -S | ||
806 | endif | ||
807 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version | 785 | # .tmp_vmlinux1 must be complete except kallsyms, so update vmlinux version |
808 | .tmp_vmlinux%: $(vmlinux-lds) $(vmlinux-all) FORCE | 786 | .tmp_vmlinux1: $(vmlinux-lds) $(vmlinux-all) FORCE |
809 | $(if $(filter 1,$*),$(call if_changed_rule,ksym_ld),$(call if_changed,vmlinux__)) | 787 | $(call if_changed_rule,ksym_ld) |
810 | 788 | ||
811 | .tmp_vmlinux0$(strip-ext): | 789 | .tmp_vmlinux2: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms1.o FORCE |
812 | $(Q)echo "placeholder" >$@ | 790 | $(call if_changed,vmlinux__) |
813 | 791 | ||
814 | .tmp_vmlinux1: .tmp_kallsyms0.o | 792 | .tmp_vmlinux3: $(vmlinux-lds) $(vmlinux-all) .tmp_kallsyms2.o FORCE |
815 | .tmp_vmlinux2: .tmp_kallsyms1.o | 793 | $(call if_changed,vmlinux__) |
816 | .tmp_vmlinux3: .tmp_kallsyms2.o | ||
817 | 794 | ||
818 | # Needs to visit scripts/ before $(KALLSYMS) can be used. | 795 | # Needs to visit scripts/ before $(KALLSYMS) can be used. |
819 | $(KALLSYMS): scripts ; | 796 | $(KALLSYMS): scripts ; |