Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1536064

[PATCH] objtool: fix build

From Jiri Slaby <jslaby@suse.cz>
Newsgroups linux.kernel
Subject [PATCH] objtool: fix build
Date 2016-12-05 13:50 +0100
Message-ID <sL0St-4DH-1@gated-at.bofh.it> (permalink)
References <sL0St-4DH-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


0x8d opcode was handled twice. Fixed.

Signed-off-by: Jiri Slaby <jslaby@suse.cz>
---
 tools/objtool/arch/x86/decode.c | 23 ++++++++++++++---------
 1 file changed, 14 insertions(+), 9 deletions(-)

diff --git a/tools/objtool/arch/x86/decode.c b/tools/objtool/arch/x86/decode.c
index ca4ede5ddd8c..6011ccbf9384 100644
--- a/tools/objtool/arch/x86/decode.c
+++ b/tools/objtool/arch/x86/decode.c
@@ -291,6 +291,20 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
 			break;
 		}
 
+		if (insn.rex_prefix.nbytes &&
+		    insn.rex_prefix.bytes[0] == 0x48 &&
+		    insn.modrm.nbytes && insn.modrm.bytes[0] == 0x2c &&
+		    insn.sib.nbytes && insn.sib.bytes[0] == 0x24) {
+			/* lea %(rsp), %rbp */
+			*type = INSN_STACK;
+			op->dest.type = OP_DEST_REG;
+			op->dest.reg = CFI_BP;
+			op->src.type = OP_SRC_ADD;
+			op->src.reg = CFI_SP;
+			op->src.offset = 0;
+			break;
+		}
+
 		if (insn.rex_prefix.nbytes && insn.modrm.nbytes &&
 		    insn.sib.nbytes && insn.rex_prefix.bytes[0] == 0x4c &&
 		    insn.modrm.bytes[0] == 0x54 && insn.sib.bytes[0] == 0x24 &&
@@ -342,15 +356,6 @@ int arch_decode_instruction(struct elf *elf, struct section *sec,
 		op->src.type = OP_SRC_POP;
 		break;
 
-	case 0x8d:
-		if (insn.rex_prefix.nbytes &&
-		    insn.rex_prefix.bytes[0] == 0x48 &&
-		    insn.modrm.nbytes && insn.modrm.bytes[0] == 0x2c &&
-		    insn.sib.nbytes && insn.sib.bytes[0] == 0x24)
-			/* lea %(rsp), %rbp */
-			*type = INSN_FP_SETUP;
-		break;
-
 	case 0x90:
 		*type = INSN_NOP;
 		break;
-- 
2.11.0

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

[PATCH] objtool: fix build Jiri Slaby <jslaby@suse.cz> - 2016-12-05 13:50 +0100
  Re: [PATCH] objtool: fix build Josh Poimboeuf <jpoimboe@redhat.com> - 2016-12-05 21:50 +0100

csiph-web