public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: "Martin Liška" <mliska@suse.cz>
To: Cary Coutant <ccoutant@gmail.com>
Cc: Binutils <binutils@sourceware.org>, Ian Lance Taylor <iant@golang.org>
Subject: Re: [PATCH] gold: fix crash for empty file
Date: Thu, 6 Jan 2022 09:35:24 +0100	[thread overview]
Message-ID: <3c9eb1e3-6dd0-8e51-312f-beedecd5facc@suse.cz> (raw)
In-Reply-To: <CAJimCsFP6h1qXxaF5zRCegHf7RG+bMoX8704jn4D9XcCWV3xqg@mail.gmail.com>

On 1/5/22 18:35, Cary Coutant wrote:
>>>> @@ -701,6 +701,8 @@ Symbol_table::resolve_forwards(const Symbol* from) const
>>>>    Symbol*
>>>>    Symbol_table::lookup(const char* name, const char* version) const
>>>>    {
>>>> +  if (name == NULL)
>>>> +    return NULL;
> 
> I'm more concerned with why a NULL name got passed to lookup in the
> first place. In this test case, it's because parameters->entry() is
> returning NULL, which in turn is because no (valid) object files have
> been named, so a target hasn't been determined. I'd be more
> comfortable with maintaining the requirement of passing a non-null
> name to Symbol_table::lookup() (perhaps even adding an assert to that
> effect), and then fixing Plugin_hook::run() to check for NULL before
> calling lookup.

Sure, I must confess I don't know gold enough. Thus, leaving that to you.

Cheers,
Martin

> 
> -cary


      reply	other threads:[~2022-01-06  8:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-11-19 14:01 Martin Liška
2021-11-29  9:00 ` Martin Liška
2022-01-05 10:15   ` Martin Liška
2022-01-05 17:35     ` Cary Coutant
2022-01-06  8:35       ` Martin Liška [this message]

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=3c9eb1e3-6dd0-8e51-312f-beedecd5facc@suse.cz \
    --to=mliska@suse.cz \
    --cc=binutils@sourceware.org \
    --cc=ccoutant@gmail.com \
    --cc=iant@golang.org \
    /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).