MCPcopy Create free account
hub / github.com/Rust-for-Linux/klint / binary_analysis

Function binary_analysis

src/binary_analysis/mod.rs:13–26  ·  view source on GitHub ↗
(cx: &AnalysisCtxt<'tcx>, path: &Path)

Source from the content-addressed store, hash-verified

11pub(crate) mod stack_size;
12
13pub fn binary_analysis<'tcx>(cx: &AnalysisCtxt<'tcx>, path: &Path) {
14 let file = File::open(path).unwrap();
15 let meta = file.metadata().unwrap();
16 if !meta.is_file() {
17 // We cannot handle special devices (this can be e.g. /dev/null).
18 return;
19 }
20
21 let mmap = unsafe { rustc_data_structures::memmap::Mmap::map(file) }.unwrap();
22 let object = ObjectFile::parse(&*mmap).unwrap();
23
24 build_error::build_error_detection(cx, &object);
25 stack_size::stack_size_check(cx, &object);
26}
27
28fn find_symbol_from_section_offset<'obj>(
29 file: &ObjectFile<'obj>,

Callers 1

after_codegenMethod · 0.85

Calls 3

build_error_detectionFunction · 0.85
stack_size_checkFunction · 0.85
unwrapMethod · 0.80

Tested by

no test coverage detected