aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-i386.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2012-08-07 16:57:49 +0000
committerJan Beulich <jbeulich@novell.com>2012-08-07 16:57:49 +0000
commit848930b2ba6024409e18d93f52fbdc206c4904c4 (patch)
treec97c7f6e0a9b58fb1cb7ea8a88c783c5022184d2 /gas/config/tc-i386.c
parent7bab8ab56f7c09acbaca2645314e0622b20c2afe (diff)
downloadgdb-848930b2ba6024409e18d93f52fbdc206c4904c4.zip
gdb-848930b2ba6024409e18d93f52fbdc206c4904c4.tar.gz
gdb-848930b2ba6024409e18d93f52fbdc206c4904c4.tar.bz2
Despite them being ignored by the CPU, gas issues segment override
prefixes for other than FS/GS in 64-bit mode. If doing so at all, it should clearly do this correctly. Determining the default segment, however, requires to take into consideration RegRex (so far, RSP, RBP, R12, and R13 were all treated equally here). gas/ 2012-08-07 Jan Beulich <jbeulich@suse.com> * config/tc-i386-intel.c (build_modrm_byte): Split determining default segment from figuring out encoding. Honor RegRex for the former. gas/testsuite/ 2012-08-07 Jan Beulich <jbeulich@suse.com> * gas/i386/x86-64-segovr.{s,l}: New. * gas/i386/i386.exp: Run new test.
Diffstat (limited to 'gas/config/tc-i386.c')
-rw-r--r--gas/config/tc-i386.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index 7cc6fa7..171749e 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -5770,18 +5770,14 @@ build_modrm_byte (void)
i.sib.base = i.base_reg->reg_num;
/* x86-64 ignores REX prefix bit here to avoid decoder
complications. */
- if ((i.base_reg->reg_num & 7) == EBP_REG_NUM)
- {
+ if (!(i.base_reg->reg_flags & RegRex)
+ && (i.base_reg->reg_num == EBP_REG_NUM
+ || i.base_reg->reg_num == ESP_REG_NUM))
default_seg = &ss;
- if (i.disp_operands == 0)
- {
- fake_zero_displacement = 1;
- i.types[op].bitfield.disp8 = 1;
- }
- }
- else if (i.base_reg->reg_num == ESP_REG_NUM)
+ if (i.base_reg->reg_num == 5 && i.disp_operands == 0)
{
- default_seg = &ss;
+ fake_zero_displacement = 1;
+ i.types[op].bitfield.disp8 = 1;
}
i.sib.scale = i.log2_scale_factor;
if (i.index_reg == 0)