xref: /linux/tools/objtool/tests/generic/fixtures/static_local.c (revision 5b6dca02b3e2254d2fd5706d76d7ab4610a67296)
1 // SPDX-License-Identifier: GPL-2.0
2 /* Static local in a patched function. */
3 
4 static const char __modinfo[]
5 	__attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
6 
target(int x)7 int target(int x)
8 {
9 	static int counter;
10 
11 	counter += 1;
12 #ifdef PATCHED
13 	return x + counter + 1;
14 #else
15 	return x + counter;
16 #endif
17 }
18