Skip to content

Commit 3350139

Browse files
author
Greentime Hu
committed
nds32: linker script: GCOV kernel may refers data in __exit
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>
1 parent ec86539 commit 3350139

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

arch/nds32/kernel/vmlinux.lds.S

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,26 @@ OUTPUT_ARCH(nds32)
1313
ENTRY(_stext_lma)
1414
jiffies = jiffies_64;
1515

16+
#if defined(CONFIG_GCOV_KERNEL)
17+
#define NDS32_EXIT_KEEP(x) x
18+
#else
19+
#define NDS32_EXIT_KEEP(x)
20+
#endif
21+
1622
SECTIONS
1723
{
1824
_stext_lma = TEXTADDR - LOAD_OFFSET;
1925
. = TEXTADDR;
2026
__init_begin = .;
2127
HEAD_TEXT_SECTION
28+
.exit.text : {
29+
NDS32_EXIT_KEEP(EXIT_TEXT)
30+
}
2231
INIT_TEXT_SECTION(PAGE_SIZE)
2332
INIT_DATA_SECTION(16)
33+
.exit.data : {
34+
NDS32_EXIT_KEEP(EXIT_DATA)
35+
}
2436
PERCPU_SECTION(L1_CACHE_BYTES)
2537
__init_end = .;
2638

0 commit comments

Comments
 (0)