diff options
| author | Alexei Starovoitov <ast@kernel.org> | 2025-04-21 08:03:10 -0700 |
|---|---|---|
| committer | Alexei Starovoitov <ast@kernel.org> | 2025-04-21 08:04:38 -0700 |
| commit | 5709be4c35ba760b001733939e20069de033a697 (patch) | |
| tree | f2f9c1dc4a9250b41e3c3adc31ce505898f89612 /scripts/link-vmlinux.sh | |
| parent | 8582d9ab3efdebb88e0cd8beed8e0b9de76443e7 (diff) | |
| parent | 9d7a0577c9db35c4cc52db90bc415ea248446472 (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf after rc3
Cross-merge bpf and other fixes after downstream PRs.
No conflicts.
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'scripts/link-vmlinux.sh')
| -rwxr-xr-x | scripts/link-vmlinux.sh | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 94c78244a2b0..51367c2bfc21 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -31,6 +31,7 @@ set -e LD="$1" KBUILD_LDFLAGS="$2" LDFLAGS_vmlinux="$3" +VMLINUX="$4" is_enabled() { grep -q "^$1=y" include/config/auto.conf @@ -97,8 +98,8 @@ vmlinux_link() ldflags="${ldflags} ${wl}--strip-debug" fi - if is_enabled CONFIG_VMLINUX_MAP; then - ldflags="${ldflags} ${wl}-Map=${output}.map" + if [ -n "${generate_map}" ]; then + ldflags="${ldflags} ${wl}-Map=vmlinux.map" fi ${ld} ${ldflags} -o ${output} \ @@ -208,6 +209,7 @@ fi btf_vmlinux_bin_o= kallsymso= strip_debug= +generate_map= if is_enabled CONFIG_KALLSYMS; then true > .tmp_vmlinux0.syms @@ -276,23 +278,27 @@ fi strip_debug= -vmlinux_link vmlinux +if is_enabled CONFIG_VMLINUX_MAP; then + generate_map=1 +fi + +vmlinux_link "${VMLINUX}" # fill in BTF IDs if is_enabled CONFIG_DEBUG_INFO_BTF; then - info BTFIDS vmlinux + info BTFIDS "${VMLINUX}" RESOLVE_BTFIDS_ARGS="" if is_enabled CONFIG_WERROR; then RESOLVE_BTFIDS_ARGS=" --fatal_warnings " fi - ${RESOLVE_BTFIDS} ${RESOLVE_BTFIDS_ARGS} vmlinux + ${RESOLVE_BTFIDS} ${RESOLVE_BTFIDS_ARGS} "${VMLINUX}" fi -mksysmap vmlinux System.map +mksysmap "${VMLINUX}" System.map if is_enabled CONFIG_BUILDTIME_TABLE_SORT; then - info SORTTAB vmlinux - if ! sorttable vmlinux; then + info SORTTAB "${VMLINUX}" + if ! sorttable "${VMLINUX}"; then echo >&2 Failed to sort kernel tables exit 1 fi @@ -308,4 +314,4 @@ if is_enabled CONFIG_KALLSYMS; then fi # For fixdep -echo "vmlinux: $0" > .vmlinux.d +echo "${VMLINUX}: $0" > ".${VMLINUX}.d" |
