[PATCH] gas/symbols: do not panic upon resolving O_md
Dmitry Selyutin
ghostmansd@gmail.com
Fri Jul 15 05:13:01 GMT 2022
On Fri, Jul 15, 2022, 07:50 Alan Modra <amodra@gmail.com> wrote:
> On Fri, Jul 15, 2022 at 12:26:52AM +0300, Dmitry Selyutin wrote:
> > + case O_md1...O_md32:
>
> Please don't use gcc extensions.
>
My initial impression was that the code uses them (e.g. ATTRIBUTE_UNUSED).
But OK, actually the first thing I did was a simple "if" in the default
section; I only thought that ranges would be more evident. Alternatively,
we could have a bunch of O_md cases; 32 cases with just a simple break
might be way too much, though. With md_resolve_symbol this makes more
sense, I think.
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).
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.
More information about the Binutils
mailing list