summaryrefslogtreecommitdiffstats
path: root/tools/objtool/check.c
diff options
context:
space:
mode:
authorChen Zhongjin <chenzhongjin@huawei.com>2022-08-18 09:45:53 +0800
committerPeter Zijlstra <peterz@infradead.org>2022-08-19 19:47:56 +0200
commit7b3e31869081771c63c3d006347ad06738f843b5 (patch)
tree633cdf2e96b5065745cf5629a742d02f3ead5c38 /tools/objtool/check.c
parent568035b01cfb107af8d2e4bd2fb9aea22cf5b868 (diff)
downloadlinux-7b3e31869081771c63c3d006347ad06738f843b5.tar.bz2
objtool: Use arch_jump_destination() in read_intra_function_calls()
Use arch_jump_destiation() instead of the open-coded 'offset + len + immediate' that is x86 specific. Avoids future trouble with other architectures. Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Link: https://lkml.kernel.org/r/20220818014553.220261-1-chenzhongjin@huawei.com
Diffstat (limited to 'tools/objtool/check.c')
-rw-r--r--tools/objtool/check.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 0cec74da7ffe..b012d987a658 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -2233,7 +2233,7 @@ static int read_intra_function_calls(struct objtool_file *file)
*/
insn->type = INSN_JUMP_UNCONDITIONAL;
- dest_off = insn->offset + insn->len + insn->immediate;
+ dest_off = arch_jump_destination(insn);
insn->jump_dest = find_insn(file, insn->sec, dest_off);
if (!insn->jump_dest) {
WARN_FUNC("can't find call dest at %s+0x%lx",