aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-09-24 01:46:42 +0000
committerAlan Modra <amodra@gmail.com>2002-09-24 01:46:42 +0000
commit52271982a769099f6f7f8db8eee700fe09490dbe (patch)
tree7a99928e4abc417a1cfd6d2a7279ebf65e156471 /gas
parent30afc28baed0b6a4368ffd0bfa65344ffcd7e20c (diff)
downloadgdb-52271982a769099f6f7f8db8eee700fe09490dbe.zip
gdb-52271982a769099f6f7f8db8eee700fe09490dbe.tar.gz
gdb-52271982a769099f6f7f8db8eee700fe09490dbe.tar.bz2
* config/tc-i386.c (process_operands): Warn about "lea" segment
overrides.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog5
-rw-r--r--gas/config/tc-i386.c19
2 files changed, 15 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 97dd2cd..eaef139 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,8 @@
+2002-09-24 Alan Modra <amodra@bigpond.net.au>
+
+ * config/tc-i386.c (process_operands): Warn about "lea" segment
+ overrides.
+
2002-09-22 Mark Elbrecht <snowball3@softhome.net>
* write.c: Delete set_segment_vma and prototype. Update all callers.
diff --git a/gas/config/tc-i386.c b/gas/config/tc-i386.c
index c46b65b..4db65b8 100644
--- a/gas/config/tc-i386.c
+++ b/gas/config/tc-i386.c
@@ -2604,9 +2604,8 @@ process_operands ()
else if (i.tm.opcode_modifier & Modrm)
{
/* The opcode is completed (modulo i.tm.extension_opcode which
- must be put into the modrm byte).
- Now, we make the modrm & index base bytes based on all the
- info we've collected. */
+ must be put into the modrm byte). Now, we make the modrm and
+ index base bytes based on all the info we've collected. */
default_seg = build_modrm_byte ();
}
@@ -2633,12 +2632,14 @@ process_operands ()
default_seg = &ds;
}
- /* If a segment was explicitly specified,
- and the specified segment is not the default,
- use an opcode prefix to select it.
- If we never figured out what the default segment is,
- then default_seg will be zero at this point,
- and the specified segment prefix will always be used. */
+ if (i.tm.base_opcode == 0x8d /* lea */ && i.seg[0] && !quiet_warnings)
+ as_warn (_("segment override on `lea' is ineffectual"));
+
+ /* If a segment was explicitly specified, and the specified segment
+ is not the default, use an opcode prefix to select it. If we
+ never figured out what the default segment is, then default_seg
+ will be zero at this point, and the specified segment prefix will
+ always be used. */
if ((i.seg[0]) && (i.seg[0] != default_seg))
{
if (!add_prefix (i.seg[0]->seg_prefix))