Re: [PATCH v2 3/3] objtool: Support stack-swizzle

From: Peter Zijlstra
Date: Tue Feb 09 2021 - 05:44:12 EST


On Tue, Feb 09, 2021 at 10:16:03AM +0100, Peter Zijlstra wrote:
> @@ -2193,6 +2232,12 @@ static int update_cfi_state(struct instr
> /* mov reg, disp(%rsp) */
> save_reg(cfi, op->src.reg, CFI_CFA,
> op->dest.offset - cfi->stack_size);
> +
> + } else if (op->src.reg == CFI_SP && op->dest.offset == 0) {
> +
> + /* mov %rsp, (%reg); # setup a stack swizzle. */
> + cfi->vals[op->dest.reg].base = CFI_SP_INDIRECT;
> + cfi->vals[op->dest.reg].offset = cfi->cfa.offset;

I'll change that to:

cfi->vals[op->dest.reg].offset = cfa->offset;

To be more consistent with the rest of the code.

> }
>
> break;
>
>