History

kbuild: do not generate .tmp_vmlinux*.map when CONFIG_VMLINUX_MAP=y

Commit 5cc124720461 ("kbuild: add CONFIG_VMLINUX_MAP expert option") mentioned that "the .map file can be rather large (several MB), and that's a waste of space when one isn't interested in these things." If that is the case, generating map files for the intermediate tmp_vmlinux* files is also a waste of space. It is unlikely that anyone would be interested in the .tmp_vmlinux*.map files. This commit stops passing the -Map= option when linking the .tmp_vmlinux* intermediates. I also hard-coded the file name 'vmlinux.map' instead of ${output}.map because a later commit will introduce vmlinux.unstripped but I want to keep the current name of the map file.

Masahiro Yamada committed 1 year ago

Commit ba4d7051 parent 479fde41 file · +7 −2Browse files

Showing the changes to scripts (1 of 1 file). Show all

Unified · Split

scripts/link-vmlinux.sh+7−2
@@ -97,8 +97,8 @@ vmlinux_link() · 96 unmodified lines
97 ldflags="${ldflags} ${wl}--strip-debug"97 ldflags="${ldflags} ${wl}--strip-debug"
98 fi98 fi
99 99
100 if is_enabled CONFIG_VMLINUX_MAP; then100 if [ -n "${generate_map}" ]; then
101 ldflags="${ldflags} ${wl}-Map=${output}.map"101 ldflags="${ldflags} ${wl}-Map=vmlinux.map"
102 fi102 fi
103 103
104 ${ld} ${ldflags} -o ${output} \104 ${ld} ${ldflags} -o ${output} \
@@ -210,6 +210,7 @@ fi · 105 unmodified lines
210btf_vmlinux_bin_o=210btf_vmlinux_bin_o=
211kallsymso=211kallsymso=
212strip_debug=212strip_debug=
213generate_map=
213 214
214if is_enabled CONFIG_KALLSYMS; then215if is_enabled CONFIG_KALLSYMS; then
215 true > .tmp_vmlinux0.syms216 true > .tmp_vmlinux0.syms
@@ -278,6 +279,10 @@ fi · 62 unmodified lines
278 279
279strip_debug=280strip_debug=
280 281
282if is_enabled CONFIG_VMLINUX_MAP; then
283 generate_map=1
284fi
285
281vmlinux_link vmlinux286vmlinux_link vmlinux
282 287
283# fill in BTF IDs288# fill in BTF IDs