Your browser sucks, JavaScript disabled! Gunnar's console needs JavaScript and WebAssembly. Git over SSH on port 2222 does not.

nordisk/heimdall

docs/v2/binary-graph.md

Binary to graph: heimdall graph bin (moved to nornir)

The binary graph is nornir's crate now: nornir-mimir-bin (library mimir_bin, MIT OR Apache-2.0, nornir crates/mimir-bin). nornir is the home of every graph builder; the crate moved there on 2026-11-08 with its history (Andreas Persson's analyzer, heimdall 7511e7f / 6582604, and the bingraph/clean round). It was never published from Heimdall (nordisk-heimdall-bingraph); Heimdall's branches bingraph/next and bingraph/clean keep the history as it was here.

The spec, the analysis, the output contract and the limits: nornir docs/v2/mimir/binary-graph.md (with its validation and handoff records beside it). Status: experimental.

What Heimdall keeps

heimdall graph bin and graph show, and graph stats of a graph bin dir, call nornir-mimir-bin from crates.io (mimir_bin::cli), so they behave as the crate's own mimir-bin command. graph src, graph stats of a graph src dir and graph check are heimdall-cli's own (CLI.md). The exit codes are shared by all five verbs: CLI.md, graph exit codes.

Commands

heimdall graph src <cargo workspace> [--bin <name>]... --out <dir> [--tools <dir>]
                   [--build] [--target-dir <dir>] [--features <features>]...
heimdall graph bin <ELF> --out <new-dir> [--arch detect|x86_64|aarch64]
                   [--libs <dir>]... [--follow-needed]
                   [--with-source <source-dump>] [--max-instructions <N>]
heimdall graph show <dir> [--function <name|0xaddr>]
heimdall graph stats <dir>

graph bin reads an ELF program, shared library, object or static archive and never runs it. To merge a source graph, pass <src-out>/mimir/src of a graph src --out <src-out> run to --with-source (not <src-out>, not <src-out>/mimir); the bridge reads the .arrow files of that one directory. Matching is by exact linker symbol, and Rust's crate disambiguator can differ between cargo check and cargo build, so graph src --build builds the binaries beside their dumps:

heimdall graph src ./program --build --out ./src-out --target-dir ./target/source
heimdall graph bin ./target/source/mimir/debug/program \
  --with-source ./src-out/mimir/src --out ./merged

How graph mode reads the binary half (a C function with a binary graph is no longer "unmapped"): graph-filter.md §10.