aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-21 20:42:11 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-21 20:42:11 +0000
commit52e1cf9d019c225dfa03720fa14d841f0b84de1a (patch)
treef2a8312536d3a7db572b48ce7d47f07f26d478f6 /gas
parent2c4747540f8a9cbfe17cae6114c505325f61036e (diff)
downloadgdb-52e1cf9d019c225dfa03720fa14d841f0b84de1a.zip
gdb-52e1cf9d019c225dfa03720fa14d841f0b84de1a.tar.gz
gdb-52e1cf9d019c225dfa03720fa14d841f0b84de1a.tar.bz2
* subsegs.c (subseg_set): Permit SEG_ABSOLUTE in know expression.
* expr.c (expr): Account for new operatorT values in know expression. * write.c (fixup_segment): Clear fixp->fx_subsy if the relocation is fully resolved.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog9
-rw-r--r--gas/expr.c57
2 files changed, 51 insertions, 15 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 2729b84..e43a831 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,12 @@
+Thu Sep 21 16:30:56 1995 Ian Lance Taylor <ian@cygnus.com>
+
+ * subsegs.c (subseg_set): Permit SEG_ABSOLUTE in know expression.
+ * expr.c (expr): Account for new operatorT values in know
+ expression.
+
+ * write.c (fixup_segment): Clear fixp->fx_subsy if the relocation
+ is fully resolved.
+
Thu Sep 21 14:11:49 1995 Michael Meissner <meissner@cygnus.com>
* config/tc-ppc.c (ppc_flags): New variable to hold the flag bits
diff --git a/gas/expr.c b/gas/expr.c
index ebc580f..132649e 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -34,6 +34,7 @@
static void floating_constant PARAMS ((expressionS * expressionP));
static void integer_constant PARAMS ((int radix, expressionS * expressionP));
static void mri_char_constant PARAMS ((expressionS *));
+static void current_location PARAMS ((expressionS *));
static void clean_up_expression PARAMS ((expressionS * expressionP));
extern const char EXP_CHARS[], FLT_CHARS[];
@@ -491,6 +492,31 @@ mri_char_constant (expressionP)
++input_line_pointer;
}
+/* Return an expression representing the current location. This
+ handles the magic symbol `.'. */
+
+static void
+current_location (expressionp)
+ expressionS *expressionp;
+{
+ if (now_seg == absolute_section)
+ {
+ expressionp->X_op = O_constant;
+ expressionp->X_add_number = abs_section_offset;
+ }
+ else
+ {
+ symbolS *symbolp;
+
+ symbolp = symbol_new (FAKE_LABEL_NAME, now_seg,
+ (valueT) frag_now_fix (),
+ frag_now);
+ expressionp->X_op = O_symbol;
+ expressionp->X_add_symbol = symbolp;
+ expressionp->X_add_number = 0;
+ }
+}
+
/*
* Summary of operand().
*
@@ -810,23 +836,17 @@ operand (expressionP)
integer_constant (16, expressionP);
break;
}
- /* Fall through. */
+
+ if (is_part_of_name (*input_line_pointer))
+ goto isname;
+
+ current_location (expressionP);
+ break;
+
case '.':
if (!is_part_of_name (*input_line_pointer))
{
- const char *fake;
-
- /* JF: '.' is pseudo symbol with value of current location
- in current segment. */
- fake = FAKE_LABEL_NAME;
- symbolP = symbol_new (fake,
- now_seg,
- (valueT) frag_now_fix (),
- frag_now);
-
- expressionP->X_op = O_symbol;
- expressionP->X_add_symbol = symbolP;
- expressionP->X_add_number = 0;
+ current_location (expressionP);
break;
}
else if ((strncasecmp (input_line_pointer, "startof.", 8) == 0
@@ -908,6 +928,13 @@ operand (expressionP)
integer_constant (16, expressionP);
break;
+ case '*':
+ if (! flag_mri || is_part_of_name (*input_line_pointer))
+ goto de_fault;
+
+ current_location (expressionP);
+ break;
+
default:
de_fault:
if (is_end_of_line[(unsigned char) c])
@@ -1272,7 +1299,7 @@ expr (rank, resultP)
op_right = operator ();
know (op_right == O_illegal || op_rank[(int) op_right] <= op_rank[(int) op_left]);
- know ((int) op_left >= (int) O_multiply && (int) op_left <= (int) O_subtract);
+ know ((int) op_left >= (int) O_multiply && (int) op_left <= (int) O_gt);
/* input_line_pointer->after right-hand quantity. */
/* left-hand quantity in resultP */