| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 |
|
| 7 | . "$(dirname "$0")/../lib.sh"
|
| 8 |
|
| 9 | setup
|
| 10 | build_pair static_call.c
|
| 11 |
|
| 12 | has_input_section orig.o .static_call_sites ||
|
| 13 | probe_skip "fixture produced no .static_call_sites on this arch"
|
| 14 |
|
| 15 | run_diff
|
| 16 | assert_patched target
|
| 17 |
|
| 18 | |
| 19 | |
| 20 | |
| 21 | assert_section .static_call_sites
|
| 22 | assert_reloc_sym .static_call_sites target
|
| 23 |
|
| 24 | rm -f "$workdir/out.o"
|
| 25 | build_pair static_call.c -DMODNAME='"klp_testmod"'
|
| 26 | run_diff 255
|
| 27 |
|
| 28 | diff_log | grep -q 'unsupported static call key __SCK__klp_test_call' ||
|
| 29 | fail "expected rejection, got: $(diff_log | tail -1)"
|
| 30 |
|
| 31 | |
| 32 | |
| 33 | [ -e "$workdir/out.o" ] &&
|
| 34 | fail "output object produced for a rejected input"
|
| 35 |
|
| 36 | pass "module-owned static call key rejected, vmlinux-owned accepted"
|