linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Masami Hiramatsu <mhiramat@kernel.org>
To: Greentime Hu <green.hu@gmail.com>
Cc: greentime@andestech.com, linux-kernel@vger.kernel.org, arnd@arndb.de
Subject: Re: [PATCH] nds32: linker script: GCOV kernel may refers data in __exit
Date: Tue, 4 Sep 2018 18:21:29 +0900	[thread overview]
Message-ID: <20180904182129.910240d80961b4fd070dfa1e@kernel.org> (raw)
In-Reply-To: <20180904075419.2994-1-greentime@andestech.com>

On Tue,  4 Sep 2018 15:54:19 +0800
Greentime Hu <green.hu@gmail.com> wrote:

> This patch is used to fix nds32 allmodconfig/allyesconfig build error
> because GCOV kernel embeds counters in the kernel for each line
> and a part of that embed in __exit text. So we need to keep the
> EXIT_TEXT and EXIT_DATA  if CONFIG_GCOV_KERNEL=y.

Yes, that is exactly what I did for arm.

Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>

Thanks!

> 
> Link: https://lkml.org/lkml/2018/9/1/125
> Signed-off-by: Greentime Hu <greentime@andestech.com>
> ---
>  arch/nds32/kernel/vmlinux.lds.S | 12 ++++++++++++
>  1 file changed, 12 insertions(+)
> 
> diff --git a/arch/nds32/kernel/vmlinux.lds.S b/arch/nds32/kernel/vmlinux.lds.S
> index 288313b886ef..9e90f30a181d 100644
> --- a/arch/nds32/kernel/vmlinux.lds.S
> +++ b/arch/nds32/kernel/vmlinux.lds.S
> @@ -13,14 +13,26 @@ OUTPUT_ARCH(nds32)
>  ENTRY(_stext_lma)
>  jiffies = jiffies_64;
>  
> +#if defined(CONFIG_GCOV_KERNEL)
> +#define NDS32_EXIT_KEEP(x)	x
> +#else
> +#define NDS32_EXIT_KEEP(x)
> +#endif
> +
>  SECTIONS
>  {
>  	_stext_lma = TEXTADDR - LOAD_OFFSET;
>  	. = TEXTADDR;
>  	__init_begin = .;
>  	HEAD_TEXT_SECTION
> +	.exit.text : {
> +		NDS32_EXIT_KEEP(EXIT_TEXT)
> +	}
>  	INIT_TEXT_SECTION(PAGE_SIZE)
>  	INIT_DATA_SECTION(16)
> +	.exit.data : {
> +		NDS32_EXIT_KEEP(EXIT_DATA)
> +	}
>  	PERCPU_SECTION(L1_CACHE_BYTES)
>  	__init_end = .;
>  
> -- 
> 2.18.0
> 


-- 
Masami Hiramatsu <mhiramat@kernel.org>

      reply	other threads:[~2018-09-04  9:21 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-04  7:54 [PATCH] nds32: linker script: GCOV kernel may refers data in __exit Greentime Hu
2018-09-04  9:21 ` Masami Hiramatsu [this message]

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=20180904182129.910240d80961b4fd070dfa1e@kernel.org \
    --to=mhiramat@kernel.org \
    --cc=arnd@arndb.de \
    --cc=green.hu@gmail.com \
    --cc=greentime@andestech.com \
    --cc=linux-kernel@vger.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;
as well as URLs for NNTP newsgroup(s).