linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Josh Poimboeuf <jpoimboe@redhat.com>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Nick Desaulniers <ndesaulniers@google.com>,
	Xi Ruoyao <xry111@mengyan1223.wang>,
	"# 3.4.x" <stable@vger.kernel.org>,
	Arnd Bergmann <arnd@kernel.org>,
	"Peter Zijlstra (Intel)" <peterz@infradead.org>,
	Miroslav Benes <mbenes@suse.cz>,
	"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)"
	<x86@kernel.org>, LKML <linux-kernel@vger.kernel.org>,
	linux-tip-commits@vger.kernel.org
Subject: Re: [tip: objtool/urgent] objtool: Fix seg fault with Clang non-section symbols
Date: Mon, 15 Feb 2021 16:22:09 -0500	[thread overview]
Message-ID: <20210215162209.5e2a475b@gandalf.local.home> (raw)
In-Reply-To: <20210215155806.bjcouvmkapj4pa4y@treble>

On Mon, 15 Feb 2021 09:58:06 -0600
Josh Poimboeuf <jpoimboe@redhat.com> wrote:

> On Mon, Feb 15, 2021 at 09:53:07AM -0500, Steven Rostedt wrote:
> > On Sun, 14 Feb 2021 09:51:47 -0600
> > Josh Poimboeuf <jpoimboe@redhat.com> wrote:
> >   
> > > Steve, looks like recordmcount avoids referencing weak symbols directly
> > > by their function symbol.  Maybe it can just skip weak symbols which
> > > don't have a section symbol, since this seems like a rare scenario.  
> > 
> > When does the .text.unlikely section disappear? During the creation of the
> > object, or later in the linker stage?  
> 
> The section is there, but the symbol associated with the section
> (".text.unlikely" symbol) isn't generated by the assembler.
> 

Greg,

Does this fix the issue with you? It appears to fix it for my arch linux
VM that I created that uses binutils 2.36-3.

-- Steve

diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index f9b19524da11..558b67f8364e 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -562,7 +562,7 @@ static char const * __has_rel_mcount(Elf_Shdr const *const relhdr, /* reltype */
 	if (w(txthdr->sh_type) != SHT_PROGBITS ||
 	    !(_w(txthdr->sh_flags) & SHF_EXECINSTR))
 		return NULL;
-	return txtname;
+	return shdr0->sh_size ? txtname : NULL;
 }
 
 static char const *has_rel_mcount(Elf_Shdr const *const relhdr,

  reply	other threads:[~2021-02-15 21:23 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-14 22:04 [PATCH] objtool: Fix seg fault with Clang non-section symbols Josh Poimboeuf
2020-12-16 12:48 ` Miroslav Benes
2020-12-16 13:49 ` [tip: objtool/urgent] " tip-bot2 for Josh Poimboeuf
2021-02-11 13:32   ` Xi Ruoyao
2021-02-11 13:55     ` Greg Kroah-Hartman
2021-02-11 18:46       ` Nick Desaulniers
2021-02-12  9:40         ` Xi Ruoyao
2021-02-12 15:30         ` Greg Kroah-Hartman
2021-02-12 17:07           ` Josh Poimboeuf
2021-02-12 17:45             ` Steven Rostedt
2021-02-13 14:09               ` Greg Kroah-Hartman
2021-02-13 14:13                 ` Steven Rostedt
2021-02-13 15:52                   ` Josh Poimboeuf
2021-02-13 16:25                     ` Greg Kroah-Hartman
2021-02-14 15:51                       ` Josh Poimboeuf
2021-02-15 14:53                         ` Steven Rostedt
2021-02-15 15:58                           ` Josh Poimboeuf
2021-02-15 21:22                             ` Steven Rostedt [this message]
2021-02-13 13:00     ` Greg Kroah-Hartman

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=20210215162209.5e2a475b@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=arnd@kernel.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-tip-commits@vger.kernel.org \
    --cc=mbenes@suse.cz \
    --cc=ndesaulniers@google.com \
    --cc=peterz@infradead.org \
    --cc=stable@vger.kernel.org \
    --cc=x86@kernel.org \
    --cc=xry111@mengyan1223.wang \
    /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 NNTP newsgroup(s).