Merge tag 'v5.7-rc6' into objtool/core, to pick up fixes and resolve semantic conflict
[linux-2.6-microblaze.git] / tools / objtool / check.c
index 6b2b458..e36a818 100644 (file)
@@ -73,6 +73,17 @@ static struct instruction *next_insn_same_func(struct objtool_file *file,
        return find_insn(file, func->cfunc->sec, func->cfunc->offset);
 }
 
+static struct instruction *prev_insn_same_sym(struct objtool_file *file,
+                                              struct instruction *insn)
+{
+       struct instruction *prev = list_prev_entry(insn, list);
+
+       if (&prev->list != &file->insn_list && prev->func == insn->func)
+               return prev;
+
+       return NULL;
+}
+
 #define func_for_each_insn(file, func, insn)                           \
        for (insn = find_insn(file, func->sec, func->offset);           \
             insn;                                                      \
@@ -1096,8 +1107,8 @@ static struct rela *find_jump_table(struct objtool_file *file,
         * it.
         */
        for (;
-            &insn->list != &file->insn_list && insn->func && insn->func->pfunc == func;
-            insn = insn->first_jump_src ?: list_prev_entry(insn, list)) {
+            insn && insn->func && insn->func->pfunc == func;
+            insn = insn->first_jump_src ?: prev_insn_same_sym(file, insn)) {
 
                if (insn != orig_insn && insn->type == INSN_JUMP_DYNAMIC)
                        break;
@@ -1613,7 +1624,7 @@ static int update_cfi_state_regs(struct instruction *insn,
 {
        struct cfi_reg *cfa = &cfi->cfa;
 
-       if (cfa->base != CFI_SP)
+       if (cfa->base != CFI_SP && cfa->base != CFI_SP_INDIRECT)
                return 0;
 
        /* push */