diff --git a/automation/eclair_analysis/ECLAIR/analysis.ecl b/automation/eclair_analysis/ECLAIR/analysis.ecl index c6e1a7a95d..6d51cb15a8 100644 --- a/automation/eclair_analysis/ECLAIR/analysis.ecl +++ b/automation/eclair_analysis/ECLAIR/analysis.ecl @@ -37,7 +37,7 @@ their Standard Library equivalents." -doc_begin="Do not analyze intermediate linking artifacts, as they do not differ from their final counterparts for the purposes of MISRA C static analysis." -file_tag+={xen_efi_tmp, "^xen/\\.xen\\.efi\\.([01]|alt\\..*)$"} --file_tag+={xen_syms_tmp, "^xen/\\.xen-syms\\.[013]$"} +-eval_file=xen-syms-passes.ecl -frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"} -doc_end diff --git a/automation/eclair_analysis/ECLAIR/generate-xen-syms-passes.sh b/automation/eclair_analysis/ECLAIR/generate-xen-syms-passes.sh new file mode 100755 index 0000000000..7d00b96833 --- /dev/null +++ b/automation/eclair_analysis/ECLAIR/generate-xen-syms-passes.sh @@ -0,0 +1,20 @@ +#!/bin/bash + +# Hide every xen-syms linking pass except LAST_LINKING_PASS. +# The pass list is the foreach in xen/scripts/Makefile.link. + +set -e + +cd "$(dirname "$0")" +arch=$(echo "${XEN_TARGET_ARCH}" | sed -e 's/x86.*/x86/' -e 's/arm.*/arm/') +last=$(sed -n 's/^LAST_LINKING_PASS *:= *\([0-9]\).*/\1/p' \ + "../../../xen/arch/${arch}/Makefile" | head -n 1) +passes=$(sed -n 's/.*foreach n,\([0-9 ]*\).*/\1/p' \ + ../../../xen/scripts/Makefile.link | head -n 1) +test -n "${last}" +test -n "${passes}" +hidden=$(printf '%s' "${passes}" | tr -d " ${last}") + +printf '%s\n' \ + "-file_tag+={xen_syms_tmp, \"^xen/\\\\.xen-syms\\\\.[${hidden}]\$\"}" \ + >xen-syms-passes.ecl diff --git a/automation/eclair_analysis/ECLAIR/generate_ecl.sh b/automation/eclair_analysis/ECLAIR/generate_ecl.sh index b955783904..b97fc55fd2 100755 --- a/automation/eclair_analysis/ECLAIR/generate_ecl.sh +++ b/automation/eclair_analysis/ECLAIR/generate_ecl.sh @@ -20,3 +20,6 @@ accepted_rst="${ECLAIR_PROJECT_ROOT}/docs/misra/rules.rst" # Generate the list of linker-defined symbols (must be run after a Xen build) "${script_dir}/generate-linker-symbols.sh" + +# Hide every xen-syms linking pass except LAST_LINKING_PASS. +"${script_dir}/generate-xen-syms-passes.sh"