[PATCH] x86: don't wrongly scale non-8-bit displacements

H.J. Lu hjl.tools@gmail.com
Mon Jul 30 13:03:00 GMT 2018


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.



More information about the Binutils mailing list