Semantic model for aspects of ELF static linking and DWARF debug information
Standard ML
63
1,164 commits
updated Sep 19, 2026
Linksem is a formalisation of substantial parts of ELF linking and DWARF debug information. It contains:
bzip2, derived from an OCaml extraction of the Lem models above.Isabelle/HOL
extraction of the linker, ELF model, and ABI formalisations mentioned above.The ELF formalisation (and parts of the ABI formalisation) are currently also
being used as a subcomponent of the rmem architectural exploration tool,
for parsing ELF files and setting up initial machine states.
The main authors are Stephen Kell, Dominic Mulligan and Peter Sewell, with additional contributions from Thibaut Pérami, Simon Ser, Shaked Flur, Robert Norton, Ramana Kumar, Jonathan French, Brian Campbell, and Thomas Bauereiss.
The top-level directory structure is as follows:
src/adaptors/sail_interface.lem presents a simplified interface
for extracting executable process information to the ppcmem2 project.Linksem is available as an opam package and a github repo.
First, ensure you have opam (the OCaml package manager) installed,
version 2.0 or greater (opam 1 versions of ott are no longer
supported). You can use your system's package manager e.g. sudo apt-get install opam (e.g. on Ubuntu 20.04) or follow the
instructions from the opam website.
On older Ubuntu versions you will not be able to use their package
manager's opam 1 version, and will need to install opam 2 following the
instructions on the opam website.
Then opam install linksem will install the latest release version.
In the checkout directory, run opam pin add linksem ..
To rebuild and reinstall after local changes, run opam upgrade --working-dir linksem (or opam upgrade -w linksem).
To build the model from a fresh git checkout (assuming your current working
directory is linksem), cd into src and type make.
This will build the Lem model (extracting OCaml files) and build these files with the OCaml compiler.
Linksem is principally intended to be used in other code, but for testing purposes, the src/main_elf binary produces output in the style of existing tools:
src/main_elf <flag> <filename>
where <flag> is one of --file-header, --program-headers, --section-headers, --relocs, --dynamic, --in-out, --debug-dump=info.
Any infelicities or missing pieces of formalisation should be noted in a camldoc-style comment at the top of the relevant Lem file.
This software was developed by the University of Cambridge Computer Laboratory (Department of Computer Science and Technology), in part funded by EPSRC Programme Grant EP/K008528/1 REMS: Rigorous Engineering for Mainstream Systems, in part funded from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 789108, "ELVER"), and in part funded by Google.
Standard ML
32.0%
Isabelle
31.0%
HTML
11.7%
OCaml
10.5%
Coq
7.4%
Python
2.8%
C
2.6%
Assembly
1.1%
Semantic model for aspects of ELF static linking and DWARF debug information
Standard ML
63
1,164 commits
updated Sep 19, 2026
Linksem is a formalisation of substantial parts of ELF linking and DWARF debug information. It contains:
bzip2, derived from an OCaml extraction of the Lem models above.Isabelle/HOL
extraction of the linker, ELF model, and ABI formalisations mentioned above.The ELF formalisation (and parts of the ABI formalisation) are currently also
being used as a subcomponent of the rmem architectural exploration tool,
for parsing ELF files and setting up initial machine states.
The main authors are Stephen Kell, Dominic Mulligan and Peter Sewell, with additional contributions from Thibaut Pérami, Simon Ser, Shaked Flur, Robert Norton, Ramana Kumar, Jonathan French, Brian Campbell, and Thomas Bauereiss.
The top-level directory structure is as follows:
src/adaptors/sail_interface.lem presents a simplified interface
for extracting executable process information to the ppcmem2 project.Linksem is available as an opam package and a github repo.
First, ensure you have opam (the OCaml package manager) installed,
version 2.0 or greater (opam 1 versions of ott are no longer
supported). You can use your system's package manager e.g. sudo apt-get install opam (e.g. on Ubuntu 20.04) or follow the
instructions from the opam website.
On older Ubuntu versions you will not be able to use their package
manager's opam 1 version, and will need to install opam 2 following the
instructions on the opam website.
Then opam install linksem will install the latest release version.
In the checkout directory, run opam pin add linksem ..
To rebuild and reinstall after local changes, run opam upgrade --working-dir linksem (or opam upgrade -w linksem).
To build the model from a fresh git checkout (assuming your current working
directory is linksem), cd into src and type make.
This will build the Lem model (extracting OCaml files) and build these files with the OCaml compiler.
Linksem is principally intended to be used in other code, but for testing purposes, the src/main_elf binary produces output in the style of existing tools:
src/main_elf <flag> <filename>
where <flag> is one of --file-header, --program-headers, --section-headers, --relocs, --dynamic, --in-out, --debug-dump=info.
Any infelicities or missing pieces of formalisation should be noted in a camldoc-style comment at the top of the relevant Lem file.
This software was developed by the University of Cambridge Computer Laboratory (Department of Computer Science and Technology), in part funded by EPSRC Programme Grant EP/K008528/1 REMS: Rigorous Engineering for Mainstream Systems, in part funded from the European Research Council (ERC) under the European Union’s Horizon 2020 research and innovation programme (grant agreement No 789108, "ELVER"), and in part funded by Google.
Standard ML
32.0%
Isabelle
31.0%
HTML
11.7%
OCaml
10.5%
Coq
7.4%
Python
2.8%
C
2.6%
Assembly
1.1%