[PATCH] gas/symbols: do not panic upon resolving O_md

Dmitry Selyutin ghostmansd@gmail.com
Mon Jul 18 09:35:11 GMT 2022


On Sat, Jul 16, 2022 at 5:02 AM Alan Modra <amodra@gmail.com> wrote:
> > > This might avoid the fatal error, but will still hit an error later
> > > due to resolved not being set.
> > I assume you mean symbol->flags.resolving = 0, right? If so, this is set
> > after the switch (including this break).
> No, I mean what I said.
>
>       if (resolved)
>         symp->flags.resolved = 1;
>       else if (S_GET_SEGMENT (symp) != expr_section)
>         {
>           as_bad (_("can't resolve value for symbol `%s'"),
>                   S_GET_NAME (symp));
>           symp->flags.resolved = 1;
>         }

Hi Alan, could you, please, provide more details? Assuming the code
below (note the asterisk which SVP64 uses to mark the vector
registers)...

.set VREG, *%r5
.set REG, VREG
extsw REG, 2

...I end up with the following:

symp->x->value->X_op = O_md1
final_seg == expr_section

So yes, the symbol is not marked as resolved; but it passes the check
since it's in the expr section.

> > > I think this calls for an
> > > md_resolve_symbol.
> > Do you mean letting the caller define this as macro? I suggest calling it
> > in "default:" section then, with the corresponding ifdef check.

I've entered a bunch of cases instead. Looks big but at least explicit enough.

-- 
Best regards,
Dmitry Selyutin


More information about the Binutils mailing list