diff options
| author | Greentime Hu <greentime@andestech.com> | 2018-09-04 02:25:57 -0400 |
|---|---|---|
| committer | Greentime Hu <greentime@andestech.com> | 2018-09-04 22:16:26 -0400 |
| commit | 3350139c0ff3c95724b784f7109987d533cb3ecd (patch) | |
| tree | f536b2f44c50e0e5bf0db93bac33d8ede9544ca0 | |
| parent | ec865393292f5ad8d52da20788b3685ebce44c48 (diff) | |
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>
| -rw-r--r-- | arch/nds32/kernel/vmlinux.lds.S | 12 |
1 files changed, 12 insertions, 0 deletions
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) | |||
| 13 | ENTRY(_stext_lma) | 13 | ENTRY(_stext_lma) |
| 14 | jiffies = jiffies_64; | 14 | jiffies = jiffies_64; |
| 15 | 15 | ||
| 16 | #if defined(CONFIG_GCOV_KERNEL) | ||
| 17 | #define NDS32_EXIT_KEEP(x) x | ||
| 18 | #else | ||
| 19 | #define NDS32_EXIT_KEEP(x) | ||
| 20 | #endif | ||
| 21 | |||
| 16 | SECTIONS | 22 | SECTIONS |
| 17 | { | 23 | { |
| 18 | _stext_lma = TEXTADDR - LOAD_OFFSET; | 24 | _stext_lma = TEXTADDR - LOAD_OFFSET; |
| 19 | . = TEXTADDR; | 25 | . = TEXTADDR; |
| 20 | __init_begin = .; | 26 | __init_begin = .; |
| 21 | HEAD_TEXT_SECTION | 27 | HEAD_TEXT_SECTION |
| 28 | .exit.text : { | ||
| 29 | NDS32_EXIT_KEEP(EXIT_TEXT) | ||
| 30 | } | ||
| 22 | INIT_TEXT_SECTION(PAGE_SIZE) | 31 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 23 | INIT_DATA_SECTION(16) | 32 | INIT_DATA_SECTION(16) |
| 33 | .exit.data : { | ||
| 34 | NDS32_EXIT_KEEP(EXIT_DATA) | ||
| 35 | } | ||
| 24 | PERCPU_SECTION(L1_CACHE_BYTES) | 36 | PERCPU_SECTION(L1_CACHE_BYTES) |
| 25 | __init_end = .; | 37 | __init_end = .; |
| 26 | 38 | ||
