lkml.org 
[lkml]   [2021]   [Feb]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
SubjectRe: [tip: objtool/urgent] objtool: Fix seg fault with Clang non-section symbols
On Fri, 12 Feb 2021 11:07:50 -0600
Josh Poimboeuf <jpoimboe@redhat.com> wrote:


> > Any ideas are appreciated.
>
> [ Adding Steve Rostedt ]
>
> This error message comes from recordmcount. It probably can't handle
> the missing STT_SECTION symbols which are getting stripped by the new
> binutils. (Objtool also had trouble with that.)
>
> No idea why you only see this on 4.4 though.
>

Just taking a quick look, but would something like this work?

I created this against v4.4.257.

-- Steve

diff --git a/scripts/recordmcount.h b/scripts/recordmcount.h
index 04151ede8043..698404f092d0 100644
--- a/scripts/recordmcount.h
+++ b/scripts/recordmcount.h
@@ -437,6 +437,8 @@ static unsigned find_secsym_ndx(unsigned const txtndx,
if (w2(ehdr->e_machine) == EM_ARM
&& ELF_ST_TYPE(symp->st_info) == STT_FUNC)
continue;
+ if (ELF_ST_TYPE(symp->st_info) == STT_SECTION)
+ continue;

*recvalp = _w(symp->st_value);
return symp - sym0;
\
 
 \ /
  Last update: 2021-02-12 18:47    [W:0.433 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site