| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 | |
| 7 | |
| 8 | |
| 9 | |
| 10 | |
| 11 | |
| 12 | |
| 13 | |
| 14 |
|
| 15 | . "$(dirname "$0")/../lib.sh"
|
| 16 |
|
| 17 | clang_only "kCFI is a Clang feature"
|
| 18 |
|
| 19 | setup
|
| 20 |
|
| 21 | |
| 22 | cc_supports -fsanitize=kcfi ||
|
| 23 | probe_skip "this clang does not support -fsanitize=kcfi"
|
| 24 |
|
| 25 | build_pair kcfi.c -fsanitize=kcfi
|
| 26 |
|
| 27 | assert_input_section .kcfi_traps
|
| 28 | assert_input_symbol __cfi_target
|
| 29 |
|
| 30 | run_diff
|
| 31 |
|
| 32 | assert_patched target
|
| 33 |
|
| 34 | |
| 35 | assert_symbol __cfi_target
|
| 36 | |
| 37 | assert_section .kcfi_traps
|
| 38 |
|
| 39 | pass "kCFI prefix symbol and trap entry carried with the patched function"
|