Home

Awesome

hardbound-llvm

LLVM 11 compiler pass for HardBound instrumentation for hardbound-vp.

Installation

Copy the code in this repository to llvm/lib/Transform/Hardbound in the LLVM Monorepo. Also add add_subdirectory(Hardbound) to llvm/lib/Transform/CMakeLists.txt.

Refer to the upstream documentation to setup the build environment. It is not necessary to build the entire LLVM tree as long as the configuration you employ for the LLVM source repository is ABI compatible with the binary LLVM package provided by your Linux distribution. Running make in llvm/build/lib/Transform/Hardbound should result in llvm/build/lib/LLVMHardbound.so being generated.

Usage

After generating LLVMHardbound.so run:

$ clang -Xclang -load -Xclang LLVMHardbound.so code.c

Afterwards, instrumented software must be executed with hardbound-vp.

Tests

Several tiny test programs are available, these must be compiled using:

$ make -C tests

Afterwards, tests can be run using

$ ./tests/run_tests.sh

Idea

Hardbound requires a compiler pass to insert setbound instructions for local and global variables. C pointer variables should be identifiable through LLVM IR store an getelementptr instructions. For each of these instructions, append a corresponding setbound call.

Acknowledgements

This work was supported in part by the German Federal Ministry of Education and Research (BMBF) within the project Scale4Edge under contract no. 16ME0127 and within the project VerSys under contract no. 01IW19001.

Resources