diff options
| author | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2017-10-09 03:02:35 -0400 |
| commit | 1236d6bb6e19fc72ffc6bbcdeb1bfefe450e54ee (patch) | |
| tree | 47da3feee8e263e8c9352c85cf518e624be3c211 /tools/objtool/arch/x86/decode.c | |
| parent | 750b1a6894ecc9b178c6e3d0a1170122971b2036 (diff) | |
| parent | 8a5776a5f49812d29fe4b2d0a2d71675c3facf3f (diff) | |
Merge 4.14-rc4 into staging-next
We want the staging/iio fixes in here as well to handle merge issues.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'tools/objtool/arch/x86/decode.c')
| -rw-r--r-- | tools/objtool/arch/x86/decode.c | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c index 0e8c8ec4fd4e..34a579f806e3 100644 --- a/tools/objtool/arch/x86/decode.c +++ b/tools/objtool/arch/x86/decode.c | |||
| @@ -208,14 +208,14 @@ int arch_decode_instruction(struct elf *elf, struct section *sec, | |||
| 208 | break; | 208 | break; |
| 209 | 209 | ||
| 210 | case 0x89: | 210 | case 0x89: |
| 211 | if (rex == 0x48 && modrm == 0xe5) { | 211 | if (rex_w && !rex_r && modrm_mod == 3 && modrm_reg == 4) { |
| 212 | 212 | ||
| 213 | /* mov %rsp, %rbp */ | 213 | /* mov %rsp, reg */ |
| 214 | *type = INSN_STACK; | 214 | *type = INSN_STACK; |
| 215 | op->src.type = OP_SRC_REG; | 215 | op->src.type = OP_SRC_REG; |
| 216 | op->src.reg = CFI_SP; | 216 | op->src.reg = CFI_SP; |
| 217 | op->dest.type = OP_DEST_REG; | 217 | op->dest.type = OP_DEST_REG; |
| 218 | op->dest.reg = CFI_BP; | 218 | op->dest.reg = op_to_cfi_reg[modrm_rm][rex_b]; |
| 219 | break; | 219 | break; |
| 220 | } | 220 | } |
| 221 | 221 | ||
| @@ -284,11 +284,16 @@ int arch_decode_instruction(struct elf *elf, struct section *sec, | |||
| 284 | case 0x8d: | 284 | case 0x8d: |
| 285 | if (sib == 0x24 && rex_w && !rex_b && !rex_x) { | 285 | if (sib == 0x24 && rex_w && !rex_b && !rex_x) { |
| 286 | 286 | ||
| 287 | /* lea disp(%rsp), reg */ | ||
| 288 | *type = INSN_STACK; | 287 | *type = INSN_STACK; |
| 289 | op->src.type = OP_SRC_ADD; | 288 | if (!insn.displacement.value) { |
| 289 | /* lea (%rsp), reg */ | ||
| 290 | op->src.type = OP_SRC_REG; | ||
| 291 | } else { | ||
| 292 | /* lea disp(%rsp), reg */ | ||
| 293 | op->src.type = OP_SRC_ADD; | ||
| 294 | op->src.offset = insn.displacement.value; | ||
| 295 | } | ||
| 290 | op->src.reg = CFI_SP; | 296 | op->src.reg = CFI_SP; |
| 291 | op->src.offset = insn.displacement.value; | ||
| 292 | op->dest.type = OP_DEST_REG; | 297 | op->dest.type = OP_DEST_REG; |
| 293 | op->dest.reg = op_to_cfi_reg[modrm_reg][rex_r]; | 298 | op->dest.reg = op_to_cfi_reg[modrm_reg][rex_r]; |
| 294 | 299 | ||
