summaryrefslogtreecommitdiff
path: root/tools/objtool/tests/generic/fixtures/function_removal.c
blob: d65ff604c2c5c528609b5634844d67cde648f76d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
// SPDX-License-Identifier: GPL-2.0
/*
 * A function the patch deletes, along with its only caller's use of it.  The
 * original has a symbol which the patched object simply does not, so there is
 * nothing to correlate it against.
 */

static const char __modinfo[]
	__attribute__((section(".modinfo"), used, aligned(1))) = "\0name=vmlinux";

#ifndef PATCHED
int going_away(int x)
{
	return x + 7;
}
#endif

int caller(int x)
{
#ifdef PATCHED
	return x + 1;
#else
	return going_away(x);
#endif
}