aboutsummaryrefslogtreecommitdiff
path: root/gas/cgen.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/cgen.c
parent4a5c6a1dd9976729e9ce77819fa7cf8482de5f79 (diff)
downloadgdb-2289f85d2410fb736111f0c4adf99eba874f38be.zip
gdb-2289f85d2410fb736111f0c4adf99eba874f38be.tar.gz
gdb-2289f85d2410fb736111f0c4adf99eba874f38be.tar.bz2
Teach .org to handle complex expressions
Diffstat (limited to 'gas/cgen.c')
-rw-r--r--gas/cgen.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/gas/cgen.c b/gas/cgen.c
index d2eb7ec..3baee8f 100644
--- a/gas/cgen.c
+++ b/gas/cgen.c
@@ -398,6 +398,9 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result)
{
int max_len;
fragS *old_frag;
+ expressionS *exp;
+ symbolS *sym;
+ offsetT off;
#ifdef TC_CGEN_MAX_RELAX
max_len = TC_CGEN_MAX_RELAX (insn, byte_len);
@@ -414,14 +417,24 @@ gas_cgen_finish_insn (insn, buf, length, relax_p, result)
/* Create a relaxable fragment for this instruction. */
old_frag = frag_now;
+ exp = &fixups[relax_operand].exp;
+ sym = exp->X_add_symbol;
+ off = exp->X_add_number;
+ if (exp->X_op != O_constant && exp->X_op != O_symbol)
+ {
+ /* Handle complex expressions. */
+ sym = make_expr_symbol (exp);
+ off = 0;
+ }
+
frag_var (rs_machine_dependent,
max_len - byte_len /* max chars */,
0 /* variable part already allocated */,
/* FIXME: When we machine generate the relax table,
machine generate a macro to compute subtype. */
1 /* subtype */,
- fixups[relax_operand].exp.X_add_symbol,
- fixups[relax_operand].exp.X_add_number,
+ sym,
+ off,
f);
/* Record the operand number with the fragment so md_convert_frag