[PATCH] x86: Don't display eiz with no scale

H.J. Lu hjl.tools@gmail.com
Wed Jul 15 13:57:17 GMT 2020


On Tue, Jul 14, 2020 at 11:14 PM Jan Beulich <jbeulich@suse.com> wrote:
>
> On 14.07.2020 18:54, H.J. Lu wrote:
> > On Tue, Jul 14, 2020 at 5:55 AM H.J. Lu <hjl.tools@gmail.com> wrote:
> >>
> >> On Tue, Jul 14, 2020 at 5:51 AM Jan Beulich <jbeulich@suse.com> wrote:
> >>>
> >>> On 14.07.2020 14:43, H.J. Lu wrote:
> >>>> On Mon, Jul 13, 2020 at 11:12 PM Jan Beulich <jbeulich@suse.com> wrote:
> >>>>> Nevertheless, I've meanwhile thought of a (contrived) case that was
> >>>>> broken with the code present:
> >>>>>
> >>>>>         addr32 mov $0x89abcdef, %rax
> >>>>>
> >>>>> would have got the immediate sign-extended from 32 to 64 bits.
> >>>>>
> >>>>
> >>>> I opened:
> >>>>
> >>>> https://sourceware.org/bugzilla/show_bug.cgi?id=26237
> >>>>
> >>>> There are multiple issues.
> >>>
> >>> Hmm, the former two lines there look correct to me, while the latter
> >>> two lines look to have been translated with a gas that didn't have
> >>> yesterday's change yet. IOW - I'm somewhat confused.
> >>
> >> The bug is against binutils 2.35, not master.
> >>
> >
> > Here is the patch for master branch.
>
> Ah, so your issue was just with disassembly. Yet then why not go a step
> further and (at least in 64-bit mode) print
>
> [       ]*[a-f0-9]+:    67 48 89 1c 25 ef cd ab 89      mov[ ]+%rbx,0x89abcdef
> [       ]*[a-f0-9]+:    67 89 04 25 11 22 33 ff         mov[ ]+%eax,0xff332211
>
> instead of
>
> [       ]*[a-f0-9]+:    67 48 89 1c 25 ef cd ab 89      mov[ ]+%rbx,0x89abcdef\(,%eiz,1\)
> [       ]*[a-f0-9]+:    67 89 04 25 11 22 33 ff         mov[ ]+%eax,0xff332211\(,%eiz,1\)
>
> and keep the () part only for
>
> [       ]*[a-f0-9]+:    67 89 04 65 11 22 33 ff         mov[ ]+%eax,0xff332211\(,%eiz,2\)
>
> , as there's no SIB-less way to express a base-and-index-less address?
>

Done.

I am checking in this.

-- 
H.J.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-x86-Don-t-display-eiz-with-no-scale.patch
Type: text/x-patch
Size: 8201 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/binutils/attachments/20200715/b8342002/attachment-0001.bin>


More information about the Binutils mailing list