https://github.com/agra-uni-bremen/hardbound-llvm

LLVM 11 compiler pass for HardBound instrumentation

https://github.com/agra-uni-bremen/hardbound-llvm

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
  • .zenodo.json file
  • DOI references
    Found 2 DOI reference(s) in README
  • Academic publication links
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (9.6%) to scientific vocabulary

Keywords

c hardbound llvm llvm-pass memory-safety
Last synced: 5 months ago · JSON representation

Repository

LLVM 11 compiler pass for HardBound instrumentation

Basic Info
  • Host: GitHub
  • Owner: agra-uni-bremen
  • License: mit
  • Language: C++
  • Default Branch: master
  • Homepage:
  • Size: 79.1 KB
Statistics
  • Stars: 0
  • Watchers: 9
  • Forks: 0
  • Open Issues: 0
  • Releases: 0
Topics
c hardbound llvm llvm-pass memory-safety
Created over 4 years ago · Last pushed over 4 years ago

https://github.com/agra-uni-bremen/hardbound-llvm/blob/master/

# hardbound-llvm

LLVM 11 [compiler pass][llvm compiler pass] for [HardBound][hardbound doi] instrumentation for [hardbound-vp][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][llvm build env] 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][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][hardbound doi] requires a compiler pass to insert `setbound`
instructions for local and global variables. C pointer variables should
be identifiable through LLVM IR [store][llvm store instr] an
[getelementptr][llvm getelementptr instr] 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

* https://llvm.org/docs/WritingAnLLVMPass.html
* https://llvm.org/docs/ProgrammersManual.html
* https://llvm.org/docs/LangRef.html
* https://llvm.org/devmtg/2019-10/slides/Warzynski-WritingAnLLVMPass.pdf

[llvm build env]: https://releases.llvm.org/11.0.0/docs/WritingAnLLVMPass.html#setting-up-the-build-environment
[llvm compiler pass]: https://releases.llvm.org/11.0.0/docs/WritingAnLLVMPass.html
[hardbound doi]: https://doi.org/10.1145/1353535.1346295
[llvm store instr]: https://llvm.org/docs/LangRef.html#store-instruction
[llvm getelementptr instr]: https://llvm.org/docs/LangRef.html#getelementptr-instruction
[hardbound-vp]: https://github.com/agra-uni-bremen/hardbound-vp

Owner

  • Name: agra-uni-bremen
  • Login: agra-uni-bremen
  • Kind: organization

GitHub Events

Total
Last Year