aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1997-02-12 20:38:20 +0000
committerIan Lance Taylor <ian@airs.com>1997-02-12 20:38:20 +0000
commiteb17f56cf52b7f9e6974b1de6017db2d99fe5d4f (patch)
treeafb22e349428c670dd2cf92b4e85d678a699e6e6
parent035936da058aee94f16cd82b6a433bddd9678118 (diff)
downloadgdb-eb17f56cf52b7f9e6974b1de6017db2d99fe5d4f.zip
gdb-eb17f56cf52b7f9e6974b1de6017db2d99fe5d4f.tar.gz
gdb-eb17f56cf52b7f9e6974b1de6017db2d99fe5d4f.tar.bz2
* config/tc-mips.c (my_getExpression): In mips16 mode, if it looks
like the expression was based on `.', adjust the value of the symbol.
-rw-r--r--gas/ChangeLog4
-rw-r--r--gas/config/tc-mips.c13
2 files changed, 17 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2e3978d..a9b7c4c 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,9 @@
Wed Feb 12 14:36:29 1997 Ian Lance Taylor <ian@cygnus.com>
+ * config/tc-mips.c (my_getExpression): In mips16 mode, if it looks
+ like the expression was based on `.', adjust the value of the
+ symbol.
+
* config/tc-mips.c (append_insn): Warn about an attempt to put an
extended instruction in a delay slot when not reordering. Set
prev_insn_valid even if not reordering.
diff --git a/gas/config/tc-mips.c b/gas/config/tc-mips.c
index 04be71e..c3ced95 100644
--- a/gas/config/tc-mips.c
+++ b/gas/config/tc-mips.c
@@ -7692,6 +7692,19 @@ my_getExpression (ep, str)
expression (ep);
expr_end = input_line_pointer;
input_line_pointer = save_in;
+
+ /* If we are in mips16 mode, and this is an expression based on `.',
+ then we bump the value of the symbol by 1 since that is how other
+ text symbols are handled. We don't bother to handle complex
+ expressions, just `.' plus or minus a constant. */
+ if (mips16
+ && ep->X_op == O_symbol
+ && strcmp (S_GET_NAME (ep->X_add_symbol), FAKE_LABEL_NAME) == 0
+ && S_GET_SEGMENT (ep->X_add_symbol) == now_seg
+ && ep->X_add_symbol->sy_frag == frag_now
+ && ep->X_add_symbol->sy_value.X_op == O_constant
+ && ep->X_add_symbol->sy_value.X_add_number == frag_now_fix ())
+ ++ep->X_add_symbol->sy_value.X_add_number;
}
/* Turn a string in input_line_pointer into a floating point constant