projects/linux·blob 5b6dca02 · refs

21 lines · 411 B

1// SPDX-License-Identifier: GPL-2.0
2/* Function introduced by the patch. noinline keeps it from being folded. */
3
4static const char __modinfo[]
5 __attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
6
7#ifdef PATCHED
8static __attribute__((noinline)) int klp_new_helper(int x)
9{
10 return x * 7;
11}
12#endif
13
14int target(int x)
15{
16#ifdef PATCHED
17 return klp_new_helper(x);
18#else
19 return x;
20#endif
21}