diff --git a/tools/objtool/check.c b/tools/objtool/check.c index 8733ca620..b21e47d8d 100644 --- a/tools/objtool/check.c +++ b/tools/objtool/check.c @@ -2144,6 +2144,13 @@ static int add_jump_table(struct objtool_file *file, struct instruction *insn, if (!dest_insn) break; + /* Handle the special cases compiled with Clang on LoongArch */ + if (file->elf->ehdr.e_machine == EM_LOONGARCH && reloc->sym->type == STT_SECTION && + (!insn_func(dest_insn) || insn_func(dest_insn)->pfunc != pfunc)) { + prev_offset = reloc_offset(reloc); + continue; + } + /* Make sure the destination is in the same function: */ if (!insn_func(dest_insn) || insn_func(dest_insn)->pfunc != pfunc) break;