linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH -next] objtool: use arch_jump_destination in read_intra_function_calls
@ 2022-08-18  1:45 Chen Zhongjin
  2022-08-22  9:08 ` [tip: objtool/core] objtool: Use arch_jump_destination() in read_intra_function_calls() tip-bot2 for Chen Zhongjin
  0 siblings, 1 reply; 2+ messages in thread
From: Chen Zhongjin @ 2022-08-18  1:45 UTC (permalink / raw)
  To: linux-kernel; +Cc: jpoimboe, peterz, chenzhongjin

arch_jump_destination() is used instead of offset + len + immediate
for jump destination.
But in read_intra_function_calls it didn't get changed.
It can make trouble for other arches development such as arm or ppc.
Fix it.

Signed-off-by: Chen Zhongjin <chenzhongjin@huawei.com>
---
 tools/objtool/check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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",
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [tip: objtool/core] objtool: Use arch_jump_destination() in read_intra_function_calls()
  2022-08-18  1:45 [PATCH -next] objtool: use arch_jump_destination in read_intra_function_calls Chen Zhongjin
@ 2022-08-22  9:08 ` tip-bot2 for Chen Zhongjin
  0 siblings, 0 replies; 2+ messages in thread
From: tip-bot2 for Chen Zhongjin @ 2022-08-22  9:08 UTC (permalink / raw)
  To: linux-tip-commits
  Cc: Chen Zhongjin, Peter Zijlstra (Intel), x86, linux-kernel

The following commit has been merged into the objtool/core branch of tip:

Commit-ID:     7b3e31869081771c63c3d006347ad06738f843b5
Gitweb:        https://git.kernel.org/tip/7b3e31869081771c63c3d006347ad06738f843b5
Author:        Chen Zhongjin <chenzhongjin@huawei.com>
AuthorDate:    Thu, 18 Aug 2022 09:45:53 +08:00
Committer:     Peter Zijlstra <peterz@infradead.org>
CommitterDate: Fri, 19 Aug 2022 19:47:56 +02:00

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
---
 tools/objtool/check.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 0cec74d..b012d98 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",

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-08-22  9:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-08-18  1:45 [PATCH -next] objtool: use arch_jump_destination in read_intra_function_calls Chen Zhongjin
2022-08-22  9:08 ` [tip: objtool/core] objtool: Use arch_jump_destination() in read_intra_function_calls() tip-bot2 for Chen Zhongjin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).