summaryrefslogtreecommitdiff
path: root/tools/objtool/tests/generic/fixtures/changed_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/objtool/tests/generic/fixtures/changed_data.c')
-rw-r--r--tools/objtool/tests/generic/fixtures/changed_data.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tools/objtool/tests/generic/fixtures/changed_data.c b/tools/objtool/tests/generic/fixtures/changed_data.c
new file mode 100644
index 000000000..b52461835
--- /dev/null
+++ b/tools/objtool/tests/generic/fixtures/changed_data.c
@@ -0,0 +1,16 @@
+// SPDX-License-Identifier: GPL-2.0
+/* Data whose value differs between the two builds. */
+
+static const char __modinfo[]
+ __attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
+
+#ifdef PATCHED
+int klp_test_data = 2;
+#else
+int klp_test_data = 1;
+#endif
+
+int target(int x)
+{
+ return x + klp_test_data;
+}