public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
From: Nick Clifton <nickc@redhat.com>
To: binutils@sourceware.org
Date: Tue, 08 Sep 2020 09:48:51 +0100	[thread overview]
Message-ID: <871rjck618.fsf@redhat.com> (raw)

Hi Guys,

  I am checking in the patch below to handle the situation where the
  plugin handler is asked to canonicalize a weak symbol of an unknown
  type.  This situation actually occurred in real life due to a bug in
  the LTO plugin, and that bug was made worse by the code in the handler
  not detecting it and leaving the section pointer set to NULL.

Cheers
  Nick

bfd/ChangeLog
2020-09-08  Nick Clifton  <nickc@redhat.com>

	* plugin.c (bfd_plugin_canonicalize_symtab): Handle the case of an
	unrecognized symbol type in a weak definition.

diff --git a/bfd/plugin.c b/bfd/plugin.c
index 593e277747..bed98520da 100644
--- a/bfd/plugin.c
+++ b/bfd/plugin.c
@@ -640,6 +640,8 @@ bfd_plugin_canonicalize_symtab (bfd *abfd,
 	  if (current_plugin->has_symbol_type)
 	    switch (syms[i].symbol_type)
 	      {
+	      default:
+		/* FIXME: Should we issue an error here ?  */
 	      case LDST_UNKNOWN:
 		/* What is the best fake section for LDST_UNKNOWN?  */
 	      case LDST_FUNCTION:


             reply	other threads:[~2020-09-08  8:48 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-08  8:48 Nick Clifton [this message]
2020-09-08 15:07 ` plugin handler patch Jeff Law
2020-09-08 15:26   ` Nick Clifton
2020-09-08 15:29     ` Jeff Law

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=871rjck618.fsf@redhat.com \
    --to=nickc@redhat.com \
    --cc=binutils@sourceware.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).