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.
Showing the changes to scripts (1 of 1 file). Show all
Unified · Split
| @@ -97,8 +97,8 @@ vmlinux_link() · 96 unmodified lines | ||
| 97 | 97 | ldflags="${ldflags} ${wl}--strip-debug" |
| 98 | 98 | fi |
| 99 | 99 | |
| 100 | − if is_enabled CONFIG_VMLINUX_MAP; then | |
| 101 | − ldflags="${ldflags} ${wl}-Map=${output}.map" | |
| 100 | + if [ -n "${generate_map}" ]; then | |
| 101 | + ldflags="${ldflags} ${wl}-Map=vmlinux.map" | |
| 102 | 102 | fi |
| 103 | 103 | |
| 104 | 104 | ${ld} ${ldflags} -o ${output} \ |
| @@ -210,6 +210,7 @@ fi · 105 unmodified lines | ||
| 210 | 210 | btf_vmlinux_bin_o= |
| 211 | 211 | kallsymso= |
| 212 | 212 | strip_debug= |
| 213 | +generate_map= | |
| 213 | 214 | |
| 214 | 215 | if is_enabled CONFIG_KALLSYMS; then |
| 215 | 216 | true > .tmp_vmlinux0.syms |
| @@ -278,6 +279,10 @@ fi · 62 unmodified lines | ||
| 278 | 279 | |
| 279 | 280 | strip_debug= |
| 280 | 281 | |
| 282 | +if is_enabled CONFIG_VMLINUX_MAP; then | |
| 283 | + generate_map=1 | |
| 284 | +fi | |
| 285 | + | |
| 281 | 286 | vmlinux_link vmlinux |
| 282 | 287 | |
| 283 | 288 | # fill in BTF IDs |