Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

kbuild: always create intermediate vmlinux.unstripped

Generate the intermediate vmlinux.unstripped regardless of
CONFIG_ARCH_VMLINUX_NEEDS_RELOCS.

If CONFIG_ARCH_VMLINUX_NEEDS_RELOCS is unset, vmlinux.unstripped and
vmlinux are identiacal.

This simplifies the build rule, and allows to strip more sections
by adding them to remove-section-y.

Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Reviewed-by: Nicolas Schier <nsc@kernel.org>
Link: https://patch.msgid.link/a48ca543fa2305bd17324f41606dcaed9b19f2d4.1758182101.git.legion@kernel.org
Signed-off-by: Nathan Chancellor <nathan@kernel.org>

authored by

Masahiro Yamada and committed by
Nathan Chancellor
0ce5139f 8d18ef04

+22 -23
+22 -23
scripts/Makefile.vmlinux
··· 9 9 10 10 targets := 11 11 12 - ifdef CONFIG_ARCH_VMLINUX_NEEDS_RELOCS 13 - vmlinux-final := vmlinux.unstripped 14 - 15 - quiet_cmd_strip_relocs = RSTRIP $@ 16 - cmd_strip_relocs = $(OBJCOPY) --remove-section='.rel*' --remove-section=!'.rel*.dyn' $< $@ 17 - 18 - vmlinux: $(vmlinux-final) FORCE 19 - $(call if_changed,strip_relocs) 20 - 21 - targets += vmlinux 22 - else 23 - vmlinux-final := vmlinux 24 - endif 25 - 26 12 %.o: %.c FORCE 27 13 $(call if_changed_rule,cc_o_c) 28 14 ··· 47 61 48 62 ifdef CONFIG_GENERIC_BUILTIN_DTB 49 63 targets += .builtin-dtbs.S .builtin-dtbs.o 50 - $(vmlinux-final): .builtin-dtbs.o 64 + vmlinux.unstripped: .builtin-dtbs.o 51 65 endif 52 66 53 - # vmlinux 67 + # vmlinux.unstripped 54 68 # --------------------------------------------------------------------------- 55 69 56 70 ifdef CONFIG_MODULES 57 71 targets += .vmlinux.export.o 58 - $(vmlinux-final): .vmlinux.export.o 72 + vmlinux.unstripped: .vmlinux.export.o 59 73 endif 60 74 61 75 ifdef CONFIG_ARCH_WANTS_PRE_LINK_VMLINUX 62 - $(vmlinux-final): arch/$(SRCARCH)/tools/vmlinux.arch.o 76 + vmlinux.unstripped: arch/$(SRCARCH)/tools/vmlinux.arch.o 63 77 64 78 arch/$(SRCARCH)/tools/vmlinux.arch.o: vmlinux.o FORCE 65 79 $(Q)$(MAKE) $(build)=arch/$(SRCARCH)/tools $@ ··· 72 86 $< "$(LD)" "$(KBUILD_LDFLAGS)" "$(LDFLAGS_vmlinux)" "$@"; \ 73 87 $(if $(ARCH_POSTLINK), $(MAKE) -f $(ARCH_POSTLINK) $@, true) 74 88 75 - targets += $(vmlinux-final) 76 - $(vmlinux-final): scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE 89 + targets += vmlinux.unstripped 90 + vmlinux.unstripped: scripts/link-vmlinux.sh vmlinux.o $(KBUILD_LDS) FORCE 77 91 +$(call if_changed_dep,link_vmlinux) 78 92 ifdef CONFIG_DEBUG_INFO_BTF 79 - $(vmlinux-final): $(RESOLVE_BTFIDS) 93 + vmlinux.unstripped: $(RESOLVE_BTFIDS) 80 94 endif 81 95 82 96 ifdef CONFIG_BUILDTIME_TABLE_SORT 83 - $(vmlinux-final): scripts/sorttable 97 + vmlinux.unstripped: scripts/sorttable 84 98 endif 99 + 100 + # vmlinux 101 + # --------------------------------------------------------------------------- 102 + 103 + remove-section-y := 104 + remove-section-$(CONFIG_ARCH_VMLINUX_NEEDS_RELOCS) += '.rel*' 105 + 106 + quiet_cmd_strip_relocs = OBJCOPY $@ 107 + cmd_strip_relocs = $(OBJCOPY) $(addprefix --remove-section=,$(remove-section-y)) $< $@ 108 + 109 + targets += vmlinux 110 + vmlinux: vmlinux.unstripped FORCE 111 + $(call if_changed,strip_relocs) 85 112 86 113 # modules.builtin.ranges 87 114 # --------------------------------------------------------------------------- ··· 109 110 modules.builtin vmlinux.map vmlinux.o.map FORCE 110 111 $(call if_changed,modules_builtin_ranges) 111 112 112 - vmlinux.map: $(vmlinux-final) 113 + vmlinux.map: vmlinux.unstripped 113 114 @: 114 115 115 116 endif