[PATCH 2/2] RISC-V: adjust logic to avoid register name symbols

Jan Beulich jbeulich@suse.com
Wed Feb 15 08:03:32 GMT 2023
On 15.02.2023 04:09, Nelson Chu wrote:
> Though the logic becomes kind of complicated to me, you are more
> familiar with other targets than me, so maybe this is the right way to
> do it.  Basically, the logic looks correct and fine to me, but I still
> need to run regressions in case of an accident.  Just make sure that -
> 1. The deferred_sym_rootP are the symbols that have the same names as
> GPR (or FPR, VPR in the future maybe), but we still need to add them
> into the symbol table?

Yes, with "may" inserted ahead of "need". We only need to if the probing
actually succeeds.

> 2. Even if the expression has the same name as GPR, only
> my_getSmallExpression is possible to set exp to O_register, but
> my_getExpression won't have, so the probing_insn_operands is used to
> distinguish between them?

Yes, albeit I find this distinction between the two functions suspicious
(and as said in a post-commit-message remark I'm also having trouble
spotting a pattern of when which of the two functions is [to be] used).
But I didn't want to affect existing behavior too much; iirc there was
at least one testcase which would break otherwise. As said elsewhere -
as a first step towards further improvements it would need settling on
what the intended behavior in various cases actually ought to be.

As to the role of probing_insn_operands: Its two possible non-zero
values distinguish these two cases; zero vs non-zero distinguish whether
we deal with insn operands vs directive (or alike) ones.

Jan


More information about the Binutils mailing list