[PATCH] x86-64/Intel: issue diagnostic for out of range displacement

H.J. Lu hjl.tools@gmail.com
Fri Nov 10 12:57:00 GMT 2017


On Fri, Nov 10, 2017 at 3:48 AM, Jan Beulich <JBeulich@suse.com> wrote:
> ... rather than silently dropping it altogether.
> i386_finalize_displacement() expects baseindex to already be set, so
> the respective statement needs to be moved up. This then also allows a
> subsequent conditional to be simplified.
>
> For this to not regress on 32-bit addressing, break out address size
> guessing from i386_index_check(), invoking the new function earlier so
> that i386_finalize_displacement() has i.prefix[ADDR_PREFIX] available.
> i386_addressing_mode () in turn needs i.base_reg / i.index_reg set
> earlier.
>
> gas/
> 2017-11-10  Jan Beulich  <jbeulich@suse.com>
>
>         * config/tc-i386.c (i386_index_check): Break out ...
>         (i386_addressing_mode): ... this new function.
>         * config/tc-i386-intel.c (i386_intel_operand): Do base/index
>         swapping and the setting of .baseindex earlier. Call
>         i386_addressing_mode.
>         * testsuite/gas/i386/x86-64-inval.s: Add out of range
>         displacement case.
>         * testsuite/gas/i386/x86-64-inval.l: Adjust expectations.
>

OK.

Thanks.

-- 
H.J.



More information about the Binutils mailing list