| 1 | |
| 2 |
|
| 3 |
|
| 4 | static const char __modinfo[]
|
| 5 | __attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
|
| 6 |
|
| 7 | #ifdef PATCHED
|
| 8 | static __attribute__((noinline)) int klp_new_helper(int x)
|
| 9 | {
|
| 10 | return x * 7;
|
| 11 | }
|
| 12 | #endif
|
| 13 |
|
| 14 | int target(int x)
|
| 15 | {
|
| 16 | #ifdef PATCHED
|
| 17 | return klp_new_helper(x);
|
| 18 | #else
|
| 19 | return x;
|
| 20 | #endif
|
| 21 | }
|