Merge tag 'x86-entry-2021-02-24' of git://git.kernel.org/pub/scm/linux/kernel/git...
[linux-2.6-microblaze.git] / tools / objtool / check.c
index 80e7b82..068cdb4 100644 (file)
@@ -2084,6 +2084,20 @@ static int update_cfi_state(struct instruction *insn, struct cfi_state *cfi,
                                }
                        }
 
+                       else if (op->dest.reg == CFI_SP &&
+                                cfi->vals[op->src.reg].base == CFI_SP_INDIRECT &&
+                                cfi->vals[op->src.reg].offset == cfa->offset) {
+
+                               /*
+                                * The same stack swizzle case 2) as above. But
+                                * because we can't change cfa->base, case 3)
+                                * will become a regular POP. Pretend we're a
+                                * PUSH so things don't go unbalanced.
+                                */
+                               cfi->stack_size += 8;
+                       }
+
+
                        break;
 
                case OP_SRC_ADD: