All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nathan Chancellor <nathan@kernel.org>
To: Michael Ellerman <mpe@ellerman.id.au>
Cc: ndesaulniers@google.com, linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/vmlinux.lds: Add .text.asan/tsan sections
Date: Wed, 22 Feb 2023 10:08:34 -0700	[thread overview]
Message-ID: <Y/ZMEqjpT6plg0nR@dev-arch.thelio-3990X> (raw)
In-Reply-To: <20230222060037.2897169-1-mpe@ellerman.id.au>

On Wed, Feb 22, 2023 at 05:00:37PM +1100, Michael Ellerman wrote:
> When KASAN/KCSAN are enabled clang generates .text.asan/tsan sections.
> Because they are not mentioned in the linker script warnings are
> generated, and when orphan handling is set to error that becomes a build
> error, eg:
> 
>   ld.lld: error: vmlinux.a(init/main.o):(.text.tsan.module_ctor) is
>   being placed in '.text.tsan.module_ctor' ld.lld: error:
>   vmlinux.a(init/version.o):(.text.tsan.module_ctor) is being placed in
>   '.text.tsan.module_ctor'
> 
> Fix it by adding the sections to our linker script, similar to the
> generic change made in 848378812e40 ("vmlinux.lds.h: Handle clang's
> module.{c,d}tor sections").
> 
> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>

Indeed, I had not thought about architectures not using the TEXT_TEXT
macro.

Reviewed-by: Nathan Chancellor <nathan@kernel.org>

> ---
>  arch/powerpc/kernel/vmlinux.lds.S | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/arch/powerpc/kernel/vmlinux.lds.S b/arch/powerpc/kernel/vmlinux.lds.S
> index 958e77a24f85..7a2209767adf 100644
> --- a/arch/powerpc/kernel/vmlinux.lds.S
> +++ b/arch/powerpc/kernel/vmlinux.lds.S
> @@ -125,6 +125,7 @@ SECTIONS
>  		 * included with the main text sections, so put it by itself.
>  		 */
>  		*(.sfpr);
> +		*(.text.asan.* .text.tsan.*)
>  		MEM_KEEP(init.text)
>  		MEM_KEEP(exit.text)
>  	} :text
> -- 
> 2.39.1
> 

  reply	other threads:[~2023-02-22 17:09 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-22  6:00 [PATCH] powerpc/vmlinux.lds: Add .text.asan/tsan sections Michael Ellerman
2023-02-22 17:08 ` Nathan Chancellor [this message]
2023-02-23  4:43   ` Michael Ellerman
2023-03-04 10:36 ` Michael Ellerman

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=Y/ZMEqjpT6plg0nR@dev-arch.thelio-3990X \
    --to=nathan@kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=mpe@ellerman.id.au \
    --cc=ndesaulniers@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.