This is the mail archive of the
mailing list for the binutils project.
Re: [RFC PATCH] Fix decoding of superfluous data32 prefix before superfluous rex.W prefix before push.
On Fri, Aug 3, 2012 at 4:24 PM, H.J. Lu <firstname.lastname@example.org> wrote:
> On Fri, Aug 3, 2012 at 3:59 PM, Roland McGrath <email@example.com> wrote:
>> I noticed that since you used #pass in the .d files, one could add more
>> cases to the end of x86-64-stack.s and not notice if one failed to update
>> all the .d files appropriately. So I added a nop at the end, to make sure
>> that's matched last.
>> What I was hoping is that you could tell me how to change:
>> 0: 66 48 6a ff data32 pushq $0xffffffffffffffff
>> 4: 66 48 68 01 02 03 04 data32 pushq $0x4030201
>> 0: 66 48 6a ff data32 rex.W pushq $0xffffffffffffffff
>> 4: 66 48 68 01 02 03 04 data32 rex.W pushq $0x4030201
>> i.e., recognize that the rex.W prefix was not used, as it already
>> does when there is no data32 prefix before it. Do you have an idea
>> to fix that?
> There are
> /* Bits of REX we've already used. */
> static int rex_used;
> Please make sure that it isn't set for push.
This seems to work:
diff --git a/opcodes/i386-dis.c b/opcodes/i386-dis.c
index 685e968..ed79d92 100644
@@ -12275,7 +12275,7 @@ case_L:
&& address_mode == mode_64bit
- && (sizeflag & DFLAG))
+ && ((rex & REX_W) || (sizeflag & DFLAG)))
*obufp++ = 'q';
We need to update some testcases.