public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Dmitry Selyutin <ghostmansd@gmail.com>
To: Alan Modra <amodra@gmail.com>
Cc: Binutils <binutils@sourceware.org>,
	 Luke Kenneth Casson Leighton <luke.leighton@gmail.com>
Subject: Re: [PATCH] gas/symbols: do not panic upon resolving O_md
Date: Fri, 15 Jul 2022 08:13:01 +0300	[thread overview]
Message-ID: <CAMqzjev0i46cEZJYbH9kuwuPMhCEWDJosfBuMxzom7yf0NhY1Q@mail.gmail.com> (raw)
In-Reply-To: <YtDyBZPmm0BZcqze@squeak.grove.modra.org>

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.

  reply	other threads:[~2022-07-15  5:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-14 21:26 Dmitry Selyutin
2022-07-15  4:50 ` Alan Modra
2022-07-15  5:13   ` Dmitry Selyutin [this message]
2022-07-16  2:02     ` Alan Modra
2022-07-18  9:35       ` Dmitry Selyutin
2022-07-18  9:46 ` [PATCH] gas/symbols: introduce md_resolve_symbol Dmitry Selyutin
2022-07-20  3:06   ` Alan Modra
2022-07-20 13:21     ` Dmitry Selyutin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAMqzjev0i46cEZJYbH9kuwuPMhCEWDJosfBuMxzom7yf0NhY1Q@mail.gmail.com \
    --to=ghostmansd@gmail.com \
    --cc=amodra@gmail.com \
    --cc=binutils@sourceware.org \
    --cc=luke.leighton@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).