lkml.org 
[lkml]   [2020]   [Dec]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] x86/entry: use STB_GLOBAL for register restoring thunk
On Wed, Dec 23, 2020 at 03:21:26PM -0800, Nick Desaulniers wrote:
> Arnd found a randconfig that produces the warning:
>
> arch/x86/entry/thunk_64.o: warning: objtool: missing symbol for insn at
> offset 0x3e
>
> when building with LLVM_IAS=1 (use Clang's integrated assembler). Josh
> notes:
>
> With the LLVM assembler stripping the .text section symbol, objtool
> has no way to reference this code when it generates ORC unwinder
> entries, because this code is outside of any ELF function.
>
> This behavior was implemented as an optimization in LLVM 5 years ago,
> but it's not the first time this has caused issues for objtool. A patch
> has been authored against LLVM to revert the behavior, which may or may
> not be accepted. Until then use a global symbol for the thunk that way
> objtool can generate proper unwind info here with LLVM_IAS=1.

As Fangrui pointed out, the section symbol stripping is useful for when
there are a ton of sections like '-ffunction-sections' and
'-fdata-sections'. Maybe add that justification to the patch
description.

We can try to support it, though I suspect other tools may also end up
getting surprised.

> Cc: Fangrui Song <maskray@google.com>
> Reported-by: Arnd Bergmann <arnd@arndb.de>
> Suggested-by: Josh Poimboeuf <jpoimboe@redhat.com>
> Link: https://github.com/ClangBuiltLinux/linux/issues/1209
> Link: https://reviews.llvm.org/D93783
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Code looks familiar ;-)

Acked-by: Josh Poimboeuf <jpoimboe@redhat.com>

--
Josh

\
 
 \ /
  Last update: 2020-12-24 05:57    [W:0.092 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site