summaryrefslogtreecommitdiff
path: root/gas/expr.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2005-10-11 11:16:17 +0000
committerNick Clifton <nickc@redhat.com>2005-10-11 11:16:17 +0000
commit9497f5ac6bc10bdd65ea471787619bde1edca77d (patch)
tree7f36b3cb6f0d84b058dfba51242bd900edde9503 /gas/expr.h
parent1334d4d50c52bc295dace4982442369838f478b3 (diff)
downloadbinutils-gdb-9497f5ac6bc10bdd65ea471787619bde1edca77d.tar.gz
This adjusts equate handling by
- allowing true forward references (which will always assume the referenced symbols have at the point of use) through the new .eqv pseudo-op and the new == operator - disallowing changing .equiv-generated equates (so that the protection this provides is both forward and backward) - snapshotting equates when their value gets changed so that previous uses don't get affected by the new value. - allowing expressions in places where absolute expressions (or register names) are needed which were not completely resolvable at the point of their definition but which are fully resolvable at the point of use In addition it fixes PR/288.
Diffstat (limited to 'gas/expr.h')
-rw-r--r--gas/expr.h15
1 files changed, 13 insertions, 2 deletions
diff --git a/gas/expr.h b/gas/expr.h
index ddd1ce3ac37..6b88d0dfe43 100644
--- a/gas/expr.h
+++ b/gas/expr.h
@@ -143,8 +143,17 @@ typedef struct expressionS {
unsigned short X_md;
} expressionS;
+enum expr_mode
+{
+ expr_evaluate,
+ expr_normal,
+ expr_defer
+};
+
/* "result" should be type (expressionS *). */
-#define expression(result) expr (0, result)
+#define expression(result) expr (0, result, expr_normal)
+#define expression_and_evaluate(result) expr (0, result, expr_evaluate)
+#define deferred_expression(result) expr (0, result, expr_defer)
/* If an expression is O_big, look here for its value. These common
data may be clobbered whenever expr() is called. */
@@ -160,10 +169,12 @@ typedef char operator_rankT;
extern char get_symbol_end (void);
extern void expr_begin (void);
extern void expr_set_precedence (void);
-extern segT expr (int rank, expressionS * resultP);
+extern segT expr (int, expressionS *, enum expr_mode);
extern unsigned int get_single_number (void);
extern symbolS *make_expr_symbol (expressionS * expressionP);
extern int expr_symbol_where (symbolS *, char **, unsigned int *);
extern symbolS *expr_build_uconstant (offsetT);
extern symbolS *expr_build_dot (void);
+
+int resolve_expression (expressionS *);