[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241207015915.1159-5-yangtiezhu@loongson.cn>
Date: Sat, 7 Dec 2024 09:59:09 +0800
From: Tiezhu Yang <yangtiezhu@...ngson.cn>
To: Huacai Chen <chenhuacai@...nel.org>,
Josh Poimboeuf <jpoimboe@...nel.org>,
Peter Zijlstra <peterz@...radead.org>
Cc: loongarch@...ts.linux.dev,
linux-kernel@...r.kernel.org
Subject: [PATCH v5 04/10] objtool: Handle unreachable entry of rodata
When compiling with Clang on LoongArch, there exists unreachable entry of
rodata which points to a position after the function return instruction,
this is generated by compiler to fill the non-existent switch case, just
skip the entry when parsing the relocation section of rodata.
Signed-off-by: Tiezhu Yang <yangtiezhu@...ngson.cn>
---
tools/objtool/check.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/tools/objtool/check.c b/tools/objtool/check.c
index 4a23aae40c03..b85fc33fdd67 100644
--- a/tools/objtool/check.c
+++ b/tools/objtool/check.c
@@ -1994,9 +1994,10 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn,
if (!dest_insn)
break;
- /* Make sure the destination is in the same function: */
- if (!insn_func(dest_insn) || insn_func(dest_insn)->pfunc != pfunc)
- break;
+ if (!insn_func(dest_insn) || insn_func(dest_insn)->pfunc != pfunc) {
+ prev_offset = reloc_offset(reloc);
+ continue;
+ }
alt = malloc(sizeof(*alt));
if (!alt) {
--
2.42.0
Powered by blists - more mailing lists