[PATCH 1/5] gas: streamline expr_build_dot()
Jan Beulich
jbeulich@suse.com
Tue Nov 26 08:13:58 GMT 2024
On 26.11.2024 03:43, Maciej W. Rozycki wrote:
> On Fri, 22 Nov 2024, Jan Beulich wrote:
>
>> There's no point involving symbol_clone_if_forward_ref(), just for it to
>> replace dot_symbol by one obtained from symbol_temp_new_now(). For the
>> abs-section case also produce a slightly more "complete" (as in: all
>> potentially relevant fields filled) expression by going through
>> expr_build_uconstant().
>
> As I recall this cloning is needed for equated symbols, so that the value
> of `.' used in an expression used for a symbol's calculation is obtained
> at the time of the symbol's reference and not the symbol's definition.
Yet then symbol_clone_if_forward_ref() would be wrong to use here, as that
pins down . at the present location (the cloning is done to keep this
"pinning down" from affecting the original symbol). Aiui it's quite the
opposite: expr_build_dot() _wants_ to latch . at its current location. At
least according to my interpretation of all the uses of it that we
presently have.
The special treatment of forward equates is happening elsewhere, by
pseudo_set() using deferred_expression() in that case. That's entirely
unrelated to expr_build_dot() (current_location() is what the expression
parser uses).
Jan
More information about the Binutils
mailing list