public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: Nick Desaulniers <ndesaulniers@google.com>
Cc: Bernardo Meurer Costa <beme@google.com>,
	Nathan Chancellor <nathan@kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	x86@kernel.org, "H. Peter Anvin" <hpa@zytor.com>,
	Josh Poimboeuf <jpoimboe@redhat.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] x86/extable: prefer local labels in .set directives
Date: Wed, 6 Apr 2022 12:27:51 +0200	[thread overview]
Message-ID: <20220406102751.GA2731@worktop.programming.kicks-ass.net> (raw)
In-Reply-To: <20220329202148.2379697-1-ndesaulniers@google.com>

On Tue, Mar 29, 2022 at 01:21:45PM -0700, Nick Desaulniers wrote:
> Bernardo reported an error that Nathan bisected down to
> (x86_64) defconfig+LTO_CLANG_FULL+X86_PMEM_LEGACY.
> 
>     LTO     vmlinux.o
>   ld.lld: error: <instantiation>:1:13: redefinition of 'found'
>   .set found, 0
>               ^
> 
>   <inline asm>:29:1: while in macro instantiation
>   extable_type_reg reg=%eax, type=(17 | ((0) << 16))
>   ^
> 
> This appears to be another LTO specific issue similar to what was folded
> into commit 4b5305decc84 ("x86/extable: Extend extable functionality"),
> where the `.set found, 0` in DEFINE_EXTABLE_TYPE_REG in
> arch/x86/include/asm/asm.h conflicts with the symbol for the static
> function `found` in arch/x86/kernel/pmem.c.
> 
> Assembler .set directive declare symbols with global visibility, so the
> assembler may not rename such symbols in the event of a conflict. LTO
> could rename static functions if there was a conflict in C sources, but
> it cannot see into symbols defined in inline asm.
> 
> The symbols are also retained in the symbol table, regardless of LTO.
> 
> Give the symbols .L prefixes making them locally visible, so that they
> may be renamed for LTO to avoid conflicts, and to drop them from the
> symbol table regardless of LTO.
> 
> Fixes: 4b5305decc84 ("x86/extable: Extend extable functionality")
> Link: https://github.com/ClangBuiltLinux/linux/issues/1612
> Link: https://sourceware.org/binutils/docs/as/Symbol-Names.html#Local-Symbol-Names
> Reported-by: Bernardo Meurer Costa <beme@google.com>
> Debugged-by: Nathan Chancellor <nathan@kernel.org>
> Signed-off-by: Nick Desaulniers <ndesaulniers@google.com>

Thanks!

  parent reply	other threads:[~2022-04-06 14:21 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-29 20:21 [PATCH] x86/extable: prefer local labels in .set directives Nick Desaulniers
2022-03-29 20:41 ` Nathan Chancellor
2022-04-06 10:27 ` Peter Zijlstra [this message]
2022-04-07  9:46 ` [tip: x86/urgent] x86/extable: Prefer " tip-bot2 for Nick Desaulniers

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=20220406102751.GA2731@worktop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=beme@google.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=hpa@zytor.com \
    --cc=jpoimboe@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=nathan@kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=tglx@linutronix.de \
    --cc=x86@kernel.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