This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches


On Wed, May 13, 2015 at 5:34 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Tue, 12 May 2015, H.J. Lu wrote:
>
>> > Well, what do you suggest?  Your change is clearly wrong as well.
>>
>> I won't call it wrong since it implies there is a right.
>
> Of course there is a right.  The x86-64 specification is quite clear what
> happens with the prefix on jumps.  Intel CPUs are simply buggy in not
> implementing it.  And you're making binutils follow that buggy behaviour.

AMD64 and Intel64 differ in some subtle ways.

> And that is wrong.  The associated bug report is invalid.

How about this

1.  Add flavors of AMD64 and Intel64 to assembler.  Make the most
permissive one as the default.  In case of call/jmp, the default will
take AMD64.
2.  Add -Mintel64/-Mamd64 to objdump,  Make the most permissive
ones the default.

>> Given that
>>
>> 0x66 jmp/call rel32
>>
>> works on Intel processors and crashes on AMD processors.
>> I will keep my change in unlessl someone can show a real usage of
>>
>> 066 jmp/call rel16
>>
>> on AMD processors.
>
> Huh, what?  I must say I'm not very fond of your way of maintaining the
> x86-64 binutils.
>

I am keen to improve.  Pleas feel free to point outs things I should work on.

Thanks.


-- 
H.J.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]