projects/linux·blob master · refs

17 lines · 319 B

1// SPDX-License-Identifier: GPL-2.0
2/* Static local in a patched function. */
3
4static const char __modinfo[]
5 __attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
6
7int 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}