Skip to content

Commit

Permalink
nds32: linker script: GCOV kernel may refers data in __exit
Browse files Browse the repository at this point in the history
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.

Link: https://lkml.org/lkml/2018/9/1/125
Signed-off-by: Greentime Hu <greentime@andestech.com>
Reviewed-by: Masami Hiramatsu <mhiramat@kernel.org>
  • Loading branch information
Greentime Hu committed Sep 5, 2018
1 parent ec86539 commit 3350139
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions arch/nds32/kernel/vmlinux.lds.S
Original file line number Diff line number Diff line change
Expand Up @@ -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 = .;

Expand Down

0 comments on commit 3350139

Please sign in to comment.