diff options
author | Jan Beulich <jbeulich@suse.com> | 2021-06-08 14:55:56 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2021-06-08 14:55:56 +0200 |
commit | 77c59789070949a1cfbd19578c6935ccd57869c2 (patch) | |
tree | 283571b167bf04fce848bd7e472f0ceea993f3ed /gas/config | |
parent | f185acddfa246009e72e5bea95cd457ccc0cc763 (diff) | |
download | gdb-77c59789070949a1cfbd19578c6935ccd57869c2.zip gdb-77c59789070949a1cfbd19578c6935ccd57869c2.tar.gz gdb-77c59789070949a1cfbd19578c6935ccd57869c2.tar.bz2 |
x86-64: avoid bogus warnings with 32-bit addressing
With optimize_disp() adjusting i.types[].bitfield.disp after adjusting
the value to be used as displacement, it better also stores the updated
value, to avoid subsequent "... shortened to ..." warnings. Note how
optimize_imm() already does so.
The -0xffffffff tests being added expose a separate issue: The encoding
chosen should be 1 for ModR/M.mod, not 2. This will want to be taken
care of, but not right here.
This at the same time addresses a similar warning and demonstrates a
similar encoding issue with 16-bit addressing. Since it was omitted
when introducing the lea16-optimize test, add a plain lea16 one to also
cover this.
Diffstat (limited to 'gas/config')
-rw-r--r-- | gas/config/tc-i386.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c index 9dbe6dc..249f1c3 100644 --- a/gas/config/tc-i386.c +++ b/gas/config/tc-i386.c @@ -5932,6 +5932,8 @@ optimize_disp (void) || i.types[op].bitfield.disp16) && fits_in_disp8 (op_disp)) i.types[op].bitfield.disp8 = 1; + + i.op[op].disps->X_add_number = op_disp; } else if (i.reloc[op] == BFD_RELOC_386_TLS_DESC_CALL || i.reloc[op] == BFD_RELOC_X86_64_TLSDESC_CALL) |