[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <173902631974.10177.18265129202576943581.tip-bot2@tip-bot2>
Date: Sat, 08 Feb 2025 14:51:59 -0000
From: "tip-bot2 for Josh Poimboeuf" <tip-bot2@...utronix.de>
To: linux-tip-commits@...r.kernel.org
Cc: Klaus Kusche <klaus.kusche@...puterix.info>,
Josh Poimboeuf <jpoimboe@...nel.org>,
"Peter Zijlstra (Intel)" <peterz@...radead.org>, x86@...nel.org,
linux-kernel@...r.kernel.org
Subject: [tip: objtool/urgent] objtool: Ignore dangling jump table entries
The following commit has been merged into the objtool/urgent branch of tip:
Commit-ID: 3724062ca2b1364f02cf44dbea1a552227844ad1
Gitweb: https://git.kernel.org/tip/3724062ca2b1364f02cf44dbea1a552227844ad1
Author: Josh Poimboeuf <jpoimboe@...nel.org>
AuthorDate: Tue, 14 Jan 2025 13:57:58 -08:00
Committer: Peter Zijlstra <peterz@...radead.org>
CommitterDate: Sat, 08 Feb 2025 15:43:08 +01:00
objtool: Ignore dangling jump table entries
Clang sometimes leaves dangling unused jump table entries which point to
the end of the function. Ignore them.
Closes: https://lore.kernel.org/20250113235835.vqgvb7cdspksy5dn@jpoimboe
Reported-by: Klaus Kusche <klaus.kusche@...puterix.info>
Signed-off-by: Josh Poimboeuf <jpoimboe@...nel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
Link: https://lkml.kernel.org/r/ee25c0b7e80113e950bd1d4c208b671d35774ff4.1736891751.git.jpoimboe@kernel.org
---
tools/objtool/check.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 753dbc4..3520a45 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1975,6 +1975,14 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
reloc_addend(reloc) == pfunc->offset)
break;
+ /*
+ * Clang sometimes leaves dangling unused jump table entries
+ * which point to the end of the function. Ignore them.
+ */
+ if (reloc->sym->sec == pfunc->sec &&
+ reloc_addend(reloc) == pfunc->offset + pfunc->len)
+ goto next;
+
dest_insn = find_insn(file, reloc->sym->sec, reloc_addend(reloc));
if (!dest_insn)
break;
@@ -1992,6 +2000,7 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
alt->insn = dest_insn;
alt->next = insn->alts;
insn->alts = alt;
+next:
prev_offset = reloc_offset(reloc);
}
Powered by blists - more mailing lists