Skip to content

Commit 7b3e318

Browse files
Chen ZhongjinPeter Zijlstra
authored andcommitted
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
1 parent 568035b commit 7b3e318

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/objtool/check.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2233,7 +2233,7 @@ static int read_intra_function_calls(struct objtool_file *file)
22332233
*/
22342234
insn->type = INSN_JUMP_UNCONDITIONAL;
22352235

2236-
dest_off = insn->offset + insn->len + insn->immediate;
2236+
dest_off = arch_jump_destination(insn);
22372237
insn->jump_dest = find_insn(file, insn->sec, dest_off);
22382238
if (!insn->jump_dest) {
22392239
WARN_FUNC("can't find call dest at %s+0x%lx",

0 commit comments

Comments
 (0)