aboutsummaryrefslogtreecommitdiff
path: root/gas/read.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2001-03-17 03:02:06 +0000
committerAlan Modra <amodra@gmail.com>2001-03-17 03:02:06 +0000
commit2289f85d2410fb736111f0c4adf99eba874f38be (patch)
tree8478ce1c94e5faf12a6573fb302b9f6b8102f775 /gas/read.c
parent4a5c6a1dd9976729e9ce77819fa7cf8482de5f79 (diff)
downloadgdb-2289f85d2410fb736111f0c4adf99eba874f38be.zip
gdb-2289f85d2410fb736111f0c4adf99eba874f38be.tar.gz
gdb-2289f85d2410fb736111f0c4adf99eba874f38be.tar.bz2
Teach .org to handle complex expressions
Diffstat (limited to 'gas/read.c')
-rw-r--r--gas/read.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/gas/read.c b/gas/read.c
index e6462e6..29ab155 100644
--- a/gas/read.c
+++ b/gas/read.c
@@ -2379,9 +2379,17 @@ do_org (segment, exp, fill)
else
{
char *p;
+ symbolS *sym = exp->X_add_symbol;
+ offsetT off = exp->X_add_number * OCTETS_PER_BYTE;
- p = frag_var (rs_org, 1, 1, (relax_substateT) 0, exp->X_add_symbol,
- exp->X_add_number * OCTETS_PER_BYTE, (char *) NULL);
+ if (exp->X_op != O_constant && exp->X_op != O_symbol)
+ {
+ /* Handle complex expressions. */
+ sym = make_expr_symbol (exp);
+ off = 0;
+ }
+
+ p = frag_var (rs_org, 1, 1, (relax_substateT) 0, sym, off, (char *) 0);
*p = fill;
}
}