mirror of
https://github.com/xen-project/xen.git
synced 2026-10-28 10:11:27 +01:00
The hide pattern .xen-syms.[013] leaves pass 2 visible. On x86
LAST_LINKING_PASS is 2, so that is the final link. On Arm
LAST_LINKING_PASS is 3 and the final image is .xen-syms.3. Pass 2 is
usually only a symlink, so Eclair saw no program link and reported every
translation unit as unreachable.
During analysis preparation, read LAST_LINKING_PASS from the architecture
makefile and the pass numbers from the foreach list in
xen/scripts/Makefile.link. Hide every pass except that one. An earlier
pass that is a real link stays hidden. The generator runs from
generate_ecl.sh, together with the other ECLAIR configuration scripts.
Fixes: a401b5c9dc ("Eclair: re-enable scanning of the (almost) final linking step")
Signed-off-by: Dmytro Prokopchuk <dmytro_prokopchuk1@epam.com>
Acked-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
67 lines
2.2 KiB
Prolog
67 lines
2.2 KiB
Prolog
-setq=set,getenv("SET")
|
|
-project_name=getenv("ECLAIR_PROJECT_NAME")
|
|
-project_root=getenv("ECLAIR_PROJECT_ROOT")
|
|
|
|
setq(data_dir,getenv("ECLAIR_DATA_DIR"))
|
|
setq(analysis_kind,getenv("ANALYSIS_KIND"))
|
|
# setq(scheduled_analysis,nil)
|
|
|
|
# strings_map("scheduled-analysis",500,"","^.*scheduled$",0,setq(scheduled_analysis,t))
|
|
# strings_map("scheduled-analysis",500,"","^.*$",0)
|
|
# map_strings("scheduled-analysis",analysis_kind)
|
|
|
|
-enable=B.REPORT.ECB
|
|
-config=B.REPORT.ECB,output=join_paths(data_dir,"FRAME.@FRAME@.ecb")
|
|
-config=B.REPORT.ECB,preprocessed=show
|
|
-config=B.REPORT.ECB,macros=10
|
|
|
|
-enable=B.EXPLAIN
|
|
|
|
-doc_begin="These configurations serve the purpose of recognizing the 'mem*' macros as
|
|
their Standard Library equivalents."
|
|
|
|
-config=MC3A2.R21.14,call_select+=
|
|
{"macro(^memcmp$)&&any_arg(1..2, skip(__non_syntactic_paren_cast_stmts, node(string_literal)))",
|
|
"any()", violation, "%{__callslct_any_base_fmt()}", {{arg, "%{__callslct_arg_fmt()}"}}}
|
|
|
|
-config=MC3A2.R21.15,call_args+=
|
|
{"macro(^mem(cmp|move|cpy)$)", {1, 2}, "unqual_pointee_compatible",
|
|
"%{__argscmpr_culprit_fmt()}", "%{__argscmpr_evidence_fmt()}"}
|
|
|
|
-config=MC3A2.R21.16,call_select+=
|
|
{"macro(^memcmp$)&&any_arg(1..2, skip(__non_syntactic_paren_stmts, type(canonical(__memcmp_pte_types))))",
|
|
"any()", violation, "%{__callslct_any_base_fmt()}", {{arg,"%{__callslct_arg_type_fmt()}"}}}
|
|
|
|
-doc_end
|
|
|
|
-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\\..*)$"}
|
|
-eval_file=xen-syms-passes.ecl
|
|
-frames+={hide, "kind(program)&&target(xen_syms_tmp||xen_efi_tmp)"}
|
|
-doc_end
|
|
|
|
-eval_file=toolchain.ecl
|
|
-eval_file=public_APIs.ecl
|
|
|
|
-doc="Initially, there are no files tagged as adopted."
|
|
-file_tag+={adopted,"none()"}
|
|
|
|
# if(not(scheduled_analysis),
|
|
# eval_file("adopted.ecl")
|
|
# )
|
|
# if(not(scheduled_analysis),
|
|
# eval_file("out_of_scope.ecl")
|
|
# )
|
|
|
|
-eval_file=adopted.ecl
|
|
-eval_file=out_of_scope.ecl
|
|
|
|
-eval_file=deviations.ecl
|
|
-eval_file=call_properties.ecl
|
|
-eval_file=tagging.ecl
|
|
-eval_file=concat(set,".ecl")
|
|
|
|
-doc="Hide reports in external code."
|
|
-reports+={hide,all_exp_external}
|