[PATCH] gas: fix bogus error on .org involving expression

Jan Beulich jbeulich@suse.com
Fri Aug 12 11:20:05 GMT 2022


On 28.06.2022 05:15, Alan Modra wrote:
> This is just speculation but I wonder if we could just drop
> expr_section, and use undefined_section in places where we currently
> create expression symbols?

I've tried this, but failed miserably already on very basic code. In
particular resolve_symbol_value()'s handling of O_constant involves
going from expr_section to absolute_section. I cannot replace
expr_section there by undefined_section (or else, found the hard way,
at least all implicitly external symbols end up local absolute), but
clearly I also cannot simply remove that construct.

There are further places where already when doing the basic mechanical
change it seemed wrong to do that kind of replacement.

>  Conceptually, is there any real difference
> between an expression that we can't resolve just yet, and the simplest
> case of such an expression, an undefined symbol that is a forward
> reference?

The above may have to do with (at least) implicitly external symbols
not really being recorded as forward references. The forward_ref field
really is used for equates only afaict, and I don't think this can be
easily changed.

Jan


More information about the Binutils mailing list