projects/linux·blob master · refs

20 lines · 381 B

1// SPDX-License-Identifier: GPL-2.0
2/* One changed function and one unchanged function. */
3
4/* klp diff takes the object's module name from .modinfo */
5static const char __modinfo[]
6 __attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
7
8int untouched(int x)
9{
10 return x * 3;
11}
12
13int changed(int x)
14{
15#ifdef PATCHED
16 return x + 2;
17#else
18 return x + 1;
19#endif
20}