This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] x86: don't wrongly scale non-8-bit displacements
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Jan Beulich <JBeulich at suse dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Mon, 30 Jul 2018 06:02:59 -0700
- Subject: Re: [PATCH] x86: don't wrongly scale non-8-bit displacements
- References: <5B5EC12002000078001D8D17@prv1-mh.provo.novell.com>
On Mon, Jul 30, 2018 at 12:41 AM, Jan Beulich <JBeulich@suse.com> wrote:
> In commit b5014f7af2 I've removed (instead of replaced) a conditional,
> resulting in addressing forms not allowing 8-bit displacements to now
> get their displacements scaled under certain circumstances. Re-add the
> missing conditional.
>
> gas/
> 2018-07-30 Jan Beulich <jbeulich@suse.com>
>
> * config/tc-i386.c (output_disp): Restrict scaling.
> * testsuite/gas/i386/evex-no-scale.s,
> testsuite/gas/i386/evex-no-scale-32.d
> testsuite/gas/i386/evex-no-scale-64.d: New.
> * testsuite/gas/i386/i386.exp: Run new tests.
>
> --- a/gas/config/tc-i386.c
> +++ b/gas/config/tc-i386.c
> @@ -7965,7 +7965,8 @@ output_disp (fragS *insn_start_frag, off
> int size = disp_size (n);
> offsetT val = i.op[n].disps->X_add_number;
>
> - val = offset_in_range (val >> i.memshift, size);
> + val = offset_in_range (val >> (size == 1 ? i.memshift : 0),
> + size);
> p = frag_more (size);
> md_number_to_chars (p, val, size);
> }
Please open a binutils bug against binutils 2.31 first and mention
it in ChangeLog. OK with that change.
--
H.J.