diff options
| author | 2021-05-17 17:48:02 -0400 | |
|---|---|---|
| committer | 2021-05-17 17:48:02 -0400 | |
| commit | d22fe808f9a3456f16015e79f1b86a10ce13099f (patch) | |
| tree | 8e8c99d742696a810297d54d650f308f6156d466 /scripts/link-vmlinux.sh | |
| parent | drm/i915/adl_p: Disable CCS on a-step (Wa_22011186057) (diff) | |
| parent | Linux 5.13-rc1 (diff) | |
| download | wireguard-linux-d22fe808f9a3456f16015e79f1b86a10ce13099f.tar.xz wireguard-linux-d22fe808f9a3456f16015e79f1b86a10ce13099f.zip | |
Merge drm/drm-next into drm-intel-next
Time to get back in sync...
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Diffstat (limited to 'scripts/link-vmlinux.sh')
| -rwxr-xr-x | scripts/link-vmlinux.sh | 33 |
1 files changed, 18 insertions, 15 deletions
diff --git a/scripts/link-vmlinux.sh b/scripts/link-vmlinux.sh index 3b261b0f74f0..f4de4c97015b 100755 --- a/scripts/link-vmlinux.sh +++ b/scripts/link-vmlinux.sh @@ -155,6 +155,7 @@ vmlinux_link() local output=${1} local objects local strip_debug + local map_option info LD ${output} @@ -166,6 +167,10 @@ vmlinux_link() strip_debug=-Wl,--strip-debug fi + if [ -n "${CONFIG_VMLINUX_MAP}" ]; then + map_option="-Map=${output}.map" + fi + if [ "${SRCARCH}" != "um" ]; then if [ -n "${CONFIG_LTO_CLANG}" ]; then # Use vmlinux.o instead of performing the slow LTO @@ -187,6 +192,7 @@ vmlinux_link() ${LD} ${KBUILD_LDFLAGS} ${LDFLAGS_vmlinux} \ ${strip_debug#-Wl,} \ -o ${output} \ + ${map_option} \ -T ${lds} ${objects} else objects="-Wl,--whole-archive \ @@ -200,6 +206,7 @@ vmlinux_link() ${CC} ${CFLAGS_vmlinux} \ ${strip_debug} \ -o ${output} \ + ${map_option:+-Wl,${map_option}} \ -Wl,-T,${lds} \ ${objects} \ -lutil -lrt -lpthread @@ -213,6 +220,7 @@ vmlinux_link() gen_btf() { local pahole_ver + local extra_paholeopt= if ! [ -x "$(command -v ${PAHOLE})" ]; then echo >&2 "BTF: ${1}: pahole (${PAHOLE}) is not available" @@ -227,8 +235,12 @@ gen_btf() vmlinux_link ${1} + if [ "${pahole_ver}" -ge "121" ]; then + extra_paholeopt="${extra_paholeopt} --btf_gen_floats" + fi + info "BTF" ${2} - LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${1} + LLVM_OBJCOPY=${OBJCOPY} ${PAHOLE} -J ${extra_paholeopt} ${1} # Create ${2} which contains just .BTF section but no symbols. Add # SHF_ALLOC because .BTF will be part of the vmlinux image. --strip-all @@ -303,23 +315,11 @@ cleanup() rm -f .tmp_vmlinux* rm -f System.map rm -f vmlinux + rm -f vmlinux.map rm -f vmlinux.o + rm -f .vmlinux.d } -on_exit() -{ - if [ $? -ne 0 ]; then - cleanup - fi -} -trap on_exit EXIT - -on_signals() -{ - exit 1 -} -trap on_signals HUP INT QUIT TERM - # Use "make V=1" to debug this script case "${KBUILD_VERBOSE}" in *1*) @@ -441,3 +441,6 @@ if [ -n "${CONFIG_KALLSYMS}" ]; then exit 1 fi fi + +# For fixdep +echo "vmlinux: $0" > .vmlinux.d |
