xref: /linux/tools/objtool/tests/generic/test-special-section.sh (revision 12d5fc96ebbb3b948861805b32a4c3a96105ccd9)
1#!/bin/bash
2# SPDX-License-Identifier: GPL-2.0
3#
4# A .kcfi_traps entry belonging to a patched function must be extracted even
5# without ANNOTATE_DATA_SPECIAL and with a local label already at offset 0.
6
7. "$(dirname "$0")/../lib.sh"
8
9setup
10build_pair special_section.c
11
12in_symbols orig.o | grep -q 'trap_marker' ||
13	probe_skip "fixture produced no .kcfi_traps on this arch"
14
15run_diff
16
17assert_patched target
18assert_section ".kcfi_traps"
19
20pass ".kcfi_traps extracted despite a local label at offset 0"
21