File tree Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Expand file tree Collapse file tree 3 files changed +35
-0
lines changed Original file line number Diff line number Diff line change 1+ # LLVM Based Fault Injector
2+
3+ LLVM Based Fault Injector to Minimize the Impact of Binary Code.
4+
5+ ## Run sample code
6+
7+ Reference: https://github.com/rollrat/runnable-llvm/blob/master/1samples/run.py
8+
9+ Type2 Model
10+
11+ ```
12+ target file: test.c
13+
14+ 1. Compile with no optimizer options.
15+ clang test.c -S -emit-llvm -o test-1-clang.ll -mllvm -disable-llvm-optzns -disable-llvm-passes -O1
16+
17+ 2. Run faultinject pass
18+ This pass just selects target instruction using dependency checker and marking using fake extern function.
19+ opt -S test-1-clang.ll -o test-2-faultinject.ll -faultinject
20+
21+ 3. Run O2 optimizing
22+ opt -S test-2-faultinject.ll -o test-3-o2.ll -O2
23+
24+ 4-1. Run injectfault pass
25+ opt -S test-3-o2.ll -o test-4-injectfault.ll -injectfault
26+
27+ 4-2. Run deleteinjectfunc pass
28+ opt -S test-3-o2.ll -o test-4-deleteinjectfault.ll -deleteinjectfunc
29+
30+ 5. Run llc
31+ llc test-4-injectfault.ll -o test-5-injectfault.s
32+ llc test-4-deleteinjectfault.ll -o test-5-none.s
33+ ```
Original file line number Diff line number Diff line change @@ -8,4 +8,6 @@ This custom-llvm has been forked for implementing fault-injector.
88
99[ Fault Injection] ( https://github.com/rollrat/runnable-llvm/blob/master/FaultInjector.md )
1010
11+ [ Register Tracing] ( https://github.com/rollrat/runnable-llvm/blob/master/TraceRegister.md )
12+
1113[ Sample Codes] ( https://github.com/rollrat/runnable-llvm/tree/master/1samples )
You can’t perform that action at this time.
0 commit comments