xref: /linux/tools/objtool/tests/generic/fixtures/changed_data.c (revision b229562c2f44cdec4ce4b8b78428514bccff9dc0)
1*b229562cSPuranjay Mohan // SPDX-License-Identifier: GPL-2.0
2*b229562cSPuranjay Mohan /* Data whose value differs between the two builds. */
3*b229562cSPuranjay Mohan 
4*b229562cSPuranjay Mohan static const char __modinfo[]
5*b229562cSPuranjay Mohan 	__attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
6*b229562cSPuranjay Mohan 
7*b229562cSPuranjay Mohan #ifdef PATCHED
8*b229562cSPuranjay Mohan int klp_test_data = 2;
9*b229562cSPuranjay Mohan #else
10*b229562cSPuranjay Mohan int klp_test_data = 1;
11*b229562cSPuranjay Mohan #endif
12*b229562cSPuranjay Mohan 
13*b229562cSPuranjay Mohan int target(int x)
14*b229562cSPuranjay Mohan {
15*b229562cSPuranjay Mohan 	return x + klp_test_data;
16*b229562cSPuranjay Mohan }
17