This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Michael Matz <matz at suse dot de>
- Cc: Jan Beulich <JBeulich at suse dot com>, Binutils <binutils at sourceware dot org>
- Date: Tue, 12 May 2015 09:08:07 -0700
- Subject: Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Authentication-results: sourceware.org; auth=none
- References: <20150511212331 dot GA1838 at intel dot com> <5551F4E70200007800079575 at mail dot emea dot novell dot com> <CAMe9rOpDbkeFbmNbQh0a1AKhAQy-cH4HJu20o_ERQaoR6sTxbQ at mail dot gmail dot com> <55520C440200007800079718 at mail dot emea dot novell dot com> <CAMe9rOpFgSyJm-oceuDkrBYnBQGv01ywCc43WySqX21NTJYi4Q at mail dot gmail dot com> <555216370200007800079773 at mail dot emea dot novell dot com> <CAMe9rOpOx=SSUZnCFimn4fBzFqNRDch8QYLn3Os_y7EfQH65Qw at mail dot gmail dot com> <5552318402000078000798A8 at mail dot emea dot novell dot com> <CAMe9rOoqcr7aE8dr6E44KUK6JLrNMNcDNFFWhcb6K+14M=Y+=w at mail dot gmail dot com> <555233B602000078000798EF at mail dot emea dot novell dot com> <CAMe9rOrOS+K0R+r1jHCNwAkgrhjftHUOGt_wTuP8wRYcPdifmQ at mail dot gmail dot com> <555235930200007800079911 at mail dot emea dot novell dot com> <alpine dot LSU dot 2 dot 20 dot 1505121736050 dot 4883 at wotan dot suse dot de> <CAMe9rOo76QirYvEH=tX7BDBws3z=g0O8c+A1wSp+19yaNXUk1w at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1505121745550 dot 27315 at wotan dot suse dot de> <CAMe9rOqM+cojMqoz9Kwb_KedgZG-14_xFaV2mk=hNEQGUkDWVw at mail dot gmail dot com> <alpine dot LSU dot 2 dot 20 dot 1505121803030 dot 27315 at wotan dot suse dot de>
On Tue, May 12, 2015 at 9:03 AM, Michael Matz <matz@suse.de> wrote:
> Hi,
>
> On Tue, 12 May 2015, H.J. Lu wrote:
>
>> On Tue, May 12, 2015 at 8:47 AM, Michael Matz <matz@suse.de> wrote:
>> > Hi,
>> >
>> > On Tue, 12 May 2015, H.J. Lu wrote:
>> >
>> >> > Actually also that one is correctly printed I think (from a hello world
>> >> > main, where I added a jmprel16 +0):
>> >> >
>> >> > 000000000040055c <main>:
>> >> > 40055c: 55 push %rbp
>> >> > 40055d: 48 89 e5 mov %rsp,%rbp
>> >> > 400560: 48 83 ec 30 sub $0x30,%rsp
>> >> > 400564: c6 45 d1 00 movb $0x0,-0x2f(%rbp)
>> >> > 400568: c6 45 d0 61 movb $0x61,-0x30(%rbp)
>> >> > 40056c: 48 8d 45 d0 lea -0x30(%rbp),%rax
>> >> > 400570: 48 89 c2 mov %rax,%rdx
>> >> > 400573: be 44 06 40 00 mov $0x400644,%esi
>> >> > 400578: 66 e9 00 00 jmpw 57c <_init-0x3ffe8c>
>> >> >
>> >> > 000000000040057c <next>:
>> >> > 40057c: bf 52 06 40 00 mov $0x400652,%edi
>> >> > ...
>> >> >
>> >> > It shows that rip is going to be truncated.
>> >> >
>> >>
>> >> This is the same issue as
>> >>
>> >> https://sourceware.org/bugzilla/show_bug.cgi?id=18386
>> >>
>> >> On Intel processors, 0x66 prefix before direct 32-bit unconditional
>> >> call/jmp is ignored. Whatever we do is wrong on AMD or Intel
>> >> processors.
>> >
>> > Well, in that case I'd say the correct thing to do is to _not_ do any
>>
>> This is NO correct thing to do.
>
> 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. 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.
--
H.J.
- References:
- [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches
- Re: [committed, PATCH] Remove Disp16|Disp32 from 64-bit direct branches