ShellCheck - shell script analysis tool version: 0.11.0 license: GNU General Public License, version 3 website: https://www.shellcheck.net Redirect to /tmp/tmp.253sJupPND and /tmp/tmp.EbSola6LkY Tree base: ae11948d5c65 ("selftests/bpf: Run resolve_btfids only for relevant .test.o objects") Now at: 517220986b2e ("resolve_btfids: change in-place update with raw binary output") ====== Checking before the patch ====== Checking scripts/link-vmlinux.sh - 1a5ec77b938a1281fa5a5a03577fa372e6dca61be17ce2f2dbf3a5a02ee9578a In link-vmlinux.sh line 51: local output=${1} ^----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local output="${1}" In link-vmlinux.sh line 52: local objs ^--------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 53: local libs ^--------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 54: local ld ^------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 55: local ldflags ^-----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 56: local ldlibs ^----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 58: info LD ${output} ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: info LD "${output}" In link-vmlinux.sh line 83: ldflags="${CFLAGS_vmlinux}" ^---------------^ SC2154 (warning): CFLAGS_vmlinux is referenced but not assigned (did you mean 'LDFLAGS_vmlinux'?). In link-vmlinux.sh line 92: ldflags="${ldflags} ${wl}--script=${objtree}/${KBUILD_LDS}" ^--------^ SC2154 (warning): objtree is referenced but not assigned. In link-vmlinux.sh line 103: ${ld} ${ldflags} -o ${output} \ ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${ld} "${ldflags}" -o "${output}" \ In link-vmlinux.sh line 104: ${wl}--whole-archive ${objs} ${wl}--no-whole-archive \ ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${wl}--whole-archive "${objs}" ${wl}--no-whole-archive \ In link-vmlinux.sh line 105: ${wl}--start-group ${libs} ${wl}--end-group \ ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${wl}--start-group "${libs}" ${wl}--end-group \ In link-vmlinux.sh line 106: ${kallsymso} ${btf_vmlinux_bin_o} ${arch_vmlinux_o} ${ldlibs} ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kallsymso}" "${btf_vmlinux_bin_o}" "${arch_vmlinux_o}" "${ldlibs}" In link-vmlinux.sh line 113: local btf_data=${1}.btf.o ^------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local btf_data="${1}".btf.o In link-vmlinux.sh line 116: LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J ${PAHOLE_FLAGS} ${1} ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: LLVM_OBJCOPY="${OBJCOPY}" ${PAHOLE} -J "${PAHOLE_FLAGS}" "${1}" In link-vmlinux.sh line 124: --strip-all ${1} "${btf_data}" 2>/dev/null ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: --strip-all "${1}" "${btf_data}" 2>/dev/null In link-vmlinux.sh line 132: printf "${et_rel}" | dd of="${btf_data}" conv=notrunc bs=1 seek=16 status=none ^---------^ SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In link-vmlinux.sh line 140: local kallsymopt; ^--------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 147: scripts/kallsyms ${kallsymopt} "${1}" > "${2}.S" ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: scripts/kallsyms "${kallsymopt}" "${1}" > "${2}.S" In link-vmlinux.sh line 150: ${CC} ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS} \ ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${CC} "${NOSTDINC_FLAGS}" "${LINUXINCLUDE}" "${KBUILD_CPPFLAGS}" \ In link-vmlinux.sh line 151: ${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} -c -o "${2}.o" "${2}.S" ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------^ SC2153 (info): Possible misspelling: KBUILD_AFLAGS may not be assigned. Did you mean KBUILD_LDFLAGS? ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${KBUILD_AFLAGS}" "${KBUILD_AFLAGS_KERNEL}" -c -o "${2}.o" "${2}.S" In link-vmlinux.sh line 169: info NM ${2} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: info NM "${2}" In link-vmlinux.sh line 170: ${NM} -n "${1}" | sed -f "${srctree}/scripts/mksysmap" > "${2}" ^--------^ SC2154 (warning): srctree is referenced but not assigned. In link-vmlinux.sh line 175: ${NM} -S ${1} > .tmp_vmlinux.nm-sort ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${NM} -S "${1}" > .tmp_vmlinux.nm-sort In link-vmlinux.sh line 176: ${objtree}/scripts/sorttable -s .tmp_vmlinux.nm-sort ${1} ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${objtree}"/scripts/sorttable -s .tmp_vmlinux.nm-sort "${1}" In link-vmlinux.sh line 265: size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso}) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" "${kallsymso}") In link-vmlinux.sh line 269: size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso}) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" "${kallsymso}") In link-vmlinux.sh line 271: if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$size1" -ne "$size2" ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then In link-vmlinux.sh line 292: ${RESOLVE_BTFIDS} ${RESOLVE_BTFIDS_ARGS} "${VMLINUX}" ^--------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${RESOLVE_BTFIDS} "${RESOLVE_BTFIDS_ARGS}" "${VMLINUX}" For more information: https://www.shellcheck.net/wiki/SC2154 -- CFLAGS_vmlinux is referenced but ... https://www.shellcheck.net/wiki/SC3043 -- In POSIX sh, 'local' is undefined. https://www.shellcheck.net/wiki/SC2059 -- Don't use variables in the printf... ====== Checking the tree with the patch ====== Checking scripts/gen-btf.sh - 78782c60d2cc946a9e0ef88597158cec2166c4a8ff00ff1ad6906c332cfc571b In gen-btf.sh line 60: grep -q "^$1=y" ${objtree}/include/config/auto.conf ^--------^ SC2154 (warning): objtree is referenced but not assigned. ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: grep -q "^$1=y" "${objtree}"/include/config/auto.conf In gen-btf.sh line 79: ${PAHOLE} -J ${PAHOLE_FLAGS} \ ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${PAHOLE} -J "${PAHOLE_FLAGS}" \ In gen-btf.sh line 81: --btf_encode_detached=${btf1} \ ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: --btf_encode_detached="${btf1}" \ In gen-btf.sh line 85: ${RESOLVE_BTFIDS} ${RESOLVE_BTFIDS_FLAGS} \ ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${RESOLVE_BTFIDS} "${RESOLVE_BTFIDS_FLAGS}" \ In gen-btf.sh line 87: --btf ${btf1} "${ELF_FILE}" ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: --btf "${btf1}" "${ELF_FILE}" In gen-btf.sh line 99: echo "" | ${CC} -c -x c -o ${btf_data} - ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: echo "" | ${CC} -c -x c -o "${btf_data}" - In gen-btf.sh line 100: ${OBJCOPY} --add-section .BTF=${ELF_FILE}.BTF \ ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${OBJCOPY} --add-section .BTF="${ELF_FILE}".BTF \ In gen-btf.sh line 101: --set-section-flags .BTF=alloc,readonly ${btf_data} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: --set-section-flags .BTF=alloc,readonly "${btf_data}" In gen-btf.sh line 102: ${OBJCOPY} --only-section=.BTF --strip-all ${btf_data} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${OBJCOPY} --only-section=.BTF --strip-all "${btf_data}" In gen-btf.sh line 111: printf "${et_rel}" | dd of="${btf_data}" conv=notrunc bs=1 seek=16 status=none ^---------^ SC2059 (info): Don't use variables in the printf format string. Use printf '..%s..' "$foo". In gen-btf.sh line 117: ${OBJCOPY} --add-section .BTF=${ELF_FILE}.BTF ${ELF_FILE} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${OBJCOPY} --add-section .BTF="${ELF_FILE}".BTF "${ELF_FILE}" In gen-btf.sh line 122: ${OBJCOPY} --add-section .BTF.base=${btf_base} ${ELF_FILE} ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${OBJCOPY} --add-section .BTF.base="${btf_base}" "${ELF_FILE}" In gen-btf.sh line 126: ${OBJCOPY} --update-section .BTF_ids=${btf_ids} ${ELF_FILE} ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${OBJCOPY} --update-section .BTF_ids="${btf_ids}" "${ELF_FILE}" In gen-btf.sh line 130: cleanup() ^-- SC2329 (info): This function is never invoked. Check usage (or ignored if invoked indirectly). For more information: https://www.shellcheck.net/wiki/SC2154 -- objtree is referenced but not ass... https://www.shellcheck.net/wiki/SC2059 -- Don't use variables in the printf... https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ... Checking scripts/link-vmlinux.sh - 1a5ec77b938a1281fa5a5a03577fa372e6dca61be17ce2f2dbf3a5a02ee9578a In link-vmlinux.sh line 51: local output=${1} ^----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: local output="${1}" In link-vmlinux.sh line 52: local objs ^--------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 53: local libs ^--------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 54: local ld ^------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 55: local ldflags ^-----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 56: local ldlibs ^----------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 58: info LD ${output} ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: info LD "${output}" In link-vmlinux.sh line 83: ldflags="${CFLAGS_vmlinux}" ^---------------^ SC2154 (warning): CFLAGS_vmlinux is referenced but not assigned (did you mean 'LDFLAGS_vmlinux'?). In link-vmlinux.sh line 92: ldflags="${ldflags} ${wl}--script=${objtree}/${KBUILD_LDS}" ^--------^ SC2154 (warning): objtree is referenced but not assigned. In link-vmlinux.sh line 103: ${ld} ${ldflags} -o ${output} \ ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${ld} "${ldflags}" -o "${output}" \ In link-vmlinux.sh line 104: ${wl}--whole-archive ${objs} ${wl}--no-whole-archive \ ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${wl}--whole-archive "${objs}" ${wl}--no-whole-archive \ In link-vmlinux.sh line 105: ${wl}--start-group ${libs} ${wl}--end-group \ ^-----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${wl}--start-group "${libs}" ${wl}--end-group \ In link-vmlinux.sh line 106: ${kallsymso} ${btf_vmlinux_bin_o} ${arch_vmlinux_o} ${ldlibs} ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${kallsymso}" ${btf_vmlinux_bin_o} "${arch_vmlinux_o}" "${ldlibs}" In link-vmlinux.sh line 112: local kallsymopt; ^--------------^ SC3043 (warning): In POSIX sh, 'local' is undefined. In link-vmlinux.sh line 119: scripts/kallsyms ${kallsymopt} "${1}" > "${2}.S" ^-----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: scripts/kallsyms "${kallsymopt}" "${1}" > "${2}.S" In link-vmlinux.sh line 122: ${CC} ${NOSTDINC_FLAGS} ${LINUXINCLUDE} ${KBUILD_CPPFLAGS} \ ^---------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^-------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${CC} "${NOSTDINC_FLAGS}" "${LINUXINCLUDE}" "${KBUILD_CPPFLAGS}" \ In link-vmlinux.sh line 123: ${KBUILD_AFLAGS} ${KBUILD_AFLAGS_KERNEL} -c -o "${2}.o" "${2}.S" ^--------------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--------------^ SC2153 (info): Possible misspelling: KBUILD_AFLAGS may not be assigned. Did you mean KBUILD_LDFLAGS? ^---------------------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${KBUILD_AFLAGS}" "${KBUILD_AFLAGS_KERNEL}" -c -o "${2}.o" "${2}.S" In link-vmlinux.sh line 141: info NM ${2} ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: info NM "${2}" In link-vmlinux.sh line 142: ${NM} -n "${1}" | sed -f "${srctree}/scripts/mksysmap" > "${2}" ^--------^ SC2154 (warning): srctree is referenced but not assigned. In link-vmlinux.sh line 147: ${NM} -S ${1} > .tmp_vmlinux.nm-sort ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${NM} -S "${1}" > .tmp_vmlinux.nm-sort In link-vmlinux.sh line 148: ${objtree}/scripts/sorttable -s .tmp_vmlinux.nm-sort ${1} ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. ^--^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: "${objtree}"/scripts/sorttable -s .tmp_vmlinux.nm-sort "${1}" In link-vmlinux.sh line 240: size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso}) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: size1=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" "${kallsymso}") In link-vmlinux.sh line 244: size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" ${kallsymso}) ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: size2=$(${CONFIG_SHELL} "${srctree}/scripts/file-size.sh" "${kallsymso}") In link-vmlinux.sh line 246: if [ $size1 -ne $size2 ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. ^----^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: if [ "$size1" -ne "$size2" ] || [ -n "${KALLSYMS_EXTRA_PASS}" ]; then In link-vmlinux.sh line 262: ${OBJCOPY} --update-section .BTF_ids=${btfids_vmlinux} ${VMLINUX} ^--------^ SC2086 (info): Double quote to prevent globbing and word splitting. Did you mean: ${OBJCOPY} --update-section .BTF_ids=${btfids_vmlinux} "${VMLINUX}" For more information: https://www.shellcheck.net/wiki/SC2154 -- CFLAGS_vmlinux is referenced but ... https://www.shellcheck.net/wiki/SC3043 -- In POSIX sh, 'local' is undefined. https://www.shellcheck.net/wiki/SC2086 -- Double quote to prevent globbing ...