linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] objtool: fix build
Date: Wed, 14 Dec 2016 11:48:12 +0100	[thread overview]
Message-ID: <2ca6160a-9b1b-91bb-edf7-c5a9e60bfded@suse.cz> (raw)
In-Reply-To: <20161205204009.dw53cip5wyt5mcav@treble>

On 12/05/2016, 09:40 PM, Josh Poimboeuf wrote:
> On Mon, Dec 05, 2016 at 01:41:37PM +0100, Jiri Slaby wrote:
>> 0x8d opcode was handled twice. Fixed.
>>
>> Signed-off-by: Jiri Slaby <jslaby@suse.cz>
> 
> I applied the other patch to the objtool-dwarf branch, but this one
> doesn't apply (the branch already has the changes this patch is trying
> to make).

You must have the fix from upstream first to have this applied:
commit 69042bf2001b44e81cd86ab11a4637b9d9a14c5a
Author: Jiri Slaby <jslaby@suse.cz>
Date:   Mon Dec 5 11:55:51 2016 +0100

    objtool: Fix bytes check of lea's rex_prefix

Thanks.

>> ---
>>  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
>>
> 


-- 
js
suse labs

      reply	other threads:[~2016-12-14 10:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-05 12:41 [PATCH] objtool fix bytes check Jiri Slaby
2016-12-05 12:41 ` [PATCH] objtool: fix build Jiri Slaby
2016-12-05 20:40   ` Josh Poimboeuf
2016-12-14 10:48     ` Jiri Slaby [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2ca6160a-9b1b-91bb-edf7-c5a9e60bfded@suse.cz \
    --to=jslaby@suse.cz \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).