summaryrefslogtreecommitdiff
path: root/tools/objtool/tests/generic/fixtures/special_section.c
blob: d28c5541e3370633f078ff721e4f81c4ffd87991 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// SPDX-License-Identifier: GPL-2.0
/*
 * Special section entry with no ANNOTATE_DATA_SPECIAL annotation and a local
 * label at offset 0, the shape Clang produces for .kcfi_traps.
 */

static const char __modinfo[]
	__attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";

int target(int x)
{
	asm volatile(
		"1:\n\t"
		".pushsection	.kcfi_traps, \"a\"\n\t"
		".balign	4\n\t"
		"trap_marker:\n\t"
		".long		1b - .\n\t"
		".popsection\n\t");
#ifdef PATCHED
	return x + 2;
#else
	return x + 1;
#endif
}