Teaching expression() to treat some operations specially
Dmitry Selyutin
ghostmansd@gmail.com
Mon Jul 11 19:13:58 GMT 2022
On Mon, Jul 11, 2022 at 5:28 PM Dmitry Selyutin <ghostmansd@gmail.com> wrote:
> I think we're being bitten by some discrepancies between these checks
> and symbol expansion.
OK, actually it's way simpler. Some fields are left uninitialized, and
this includes fields which are later checked.
This patch below simply assigns the expression from the symbol to the
expression we process.
However, I'm not sure whether this is the right thing to do; even if
so, this logic is hardly unique for registers.
Anyway, posting here to show that with this path things work (along
with the previous patch).
diff --git a/gas/expr.c b/gas/expr.c
index f4ea24717d..a46e220526 100644
--- a/gas/expr.c
+++ b/gas/expr.c
@@ -1350,8 +1350,7 @@ operand (expressionS *expressionP, enum expr_mode mode)
}
else if (mode != expr_defer && segment == reg_section)
{
- expressionP->X_op = O_register;
- expressionP->X_add_number = S_GET_VALUE (symbolP);
+ *expressionP = *symbol_get_value_expression (symbolP);
}
else
{
--
Best regards,
Dmitry Selyutin
More information about the Binutils
mailing list