| 1 | |
| 2 | |
| 3 | |
| 4 | |
| 5 | |
| 6 |
|
| 7 | . "$(dirname "$0")/../lib.sh"
|
| 8 |
|
| 9 | setup
|
| 10 | build_pair static_local.c
|
| 11 |
|
| 12 | in_symbols orig.o | grep -q 'counter' ||
|
| 13 | probe_skip "compiler emitted no distinct static local symbol"
|
| 14 |
|
| 15 | run_diff
|
| 16 | assert_patched target
|
| 17 |
|
| 18 | out_symbols | grep -q '\.klp\.sym\..*\.counter' ||
|
| 19 | fail "static local not referenced through a klp relocation"
|
| 20 |
|
| 21 | out_symbols | grep 'counter' | grep -qvE 'UND|\.klp\.(sym|tombstone)' &&
|
| 22 | fail "static local was given a fresh definition"
|
| 23 |
|
| 24 | pass "static local correlated rather than duplicated"
|