xref: /linux/tools/objtool/tests/generic/fixtures/function_removal.c (revision 12d5fc96ebbb3b948861805b32a4c3a96105ccd9)
1 // SPDX-License-Identifier: GPL-2.0
2 /*
3  * A function the patch deletes, along with its only caller's use of it.  The
4  * original has a symbol which the patched object simply does not, so there is
5  * nothing to correlate it against.
6  */
7 
8 static const char __modinfo[]
9 	__attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";
10 
11 #ifndef PATCHED
12 int going_away(int x)
13 {
14 	return x + 7;
15 }
16 #endif
17 
18 int caller(int x)
19 {
20 #ifdef PATCHED
21 	return x + 1;
22 #else
23 	return going_away(x);
24 #endif
25 }
26