Parsing [reg+label] expressions

Fredrik Rothamel fredrik.rothamel@bahnhof.se
Wed May 16 21:04:00 GMT 2012


Hi,

I get unexpected results from gas expression parser for expressions like 
"reg+label".
md_register_arithmetic is false, so I get an O_add expression with two 
operands.
The register name is in the symbol table and is correctly recognized as 
X_op = O_register.
The label is parsed and get X_op = O_symbol but when it is inserted in 
the add expression using make_expr_symbol() the X_op information is 
lost. When I examine the complete expression, the label operand 
(X_op_symbol) has X_op = O_constant.
How do I test if this actually is constant or a symbol ?

BR,
Fredrik Rothamel



More information about the Binutils mailing list