| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 |
|
| 6 | . "$(dirname "$0")/../lib.sh"
|
| 7 |
|
| 8 | setup
|
| 9 | build_pair special_section_shared.c
|
| 10 |
|
| 11 | has_input_section orig.o .kcfi_traps ||
|
| 12 | probe_skip "fixture produced no .kcfi_traps on this arch"
|
| 13 |
|
| 14 | run_diff
|
| 15 |
|
| 16 | assert_patched target
|
| 17 | assert_not_patched other
|
| 18 | assert_section ".kcfi_traps"
|
| 19 |
|
| 20 | entries="$(out_relocs | awk '/rela\.kcfi_traps/,/^$/' | grep -c 'target')"
|
| 21 | [ "$entries" = 1 ] || fail "expected one .kcfi_traps entry, found $entries"
|
| 22 |
|
| 23 | out_relocs | awk '/rela\.kcfi_traps/,/^$/' | grep -q 'other' &&
|
| 24 | fail "the untouched function's entry was dragged in"
|
| 25 |
|
| 26 | pass "only the patched function's entry extracted"
|