Re: [PATCH v2.1 2/3] objtool,x86: Additionally decode: mov %rsp, (%reg)

From: Peter Zijlstra
Date: Wed Feb 10 2021 - 04:35:10 EST


On Wed, Feb 10, 2021 at 10:08:51AM +0100, Peter Zijlstra wrote:
> + /* skip nontrivial SIB */
> + if (modrm_rm == 4 && sib != 0x24)
> + break;

Hmm,, maybe that should be:

if (modrm_rm == 4 && !(sib == 0x24 && rex_b == rex_x))

Because what we have is that once we have a SIB byte, rex_b is for
sib_base and rex_x is always sib_index, and we need to ensure that
sib_base == sib_index for the trivial case.


/me changes...