Skip to content

Commit f54af50

Browse files
committed
csky: Correct position of _stext
Correct position of _stext to prevent check_kernel_text_object warning [1]. [1] https://lore.kernel.org/linux-csky/YfLpNkmlvoR8iPcq@ls3530/ Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org> Cc: Helge Deller <deller@gmx.de>
1 parent 49a1a3c commit f54af50

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

arch/csky/include/asm/sections.h

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
/* SPDX-License-Identifier: GPL-2.0 */
2+
3+
#ifndef __ASM_SECTIONS_H
4+
#define __ASM_SECTIONS_H
5+
6+
#include <asm-generic/sections.h>
7+
8+
extern char _start[];
9+
10+
#endif /* __ASM_SECTIONS_H */

arch/csky/kernel/setup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ static void __init csky_memblock_init(void)
3131
unsigned long max_zone_pfn[MAX_NR_ZONES] = { 0 };
3232
signed long size;
3333

34-
memblock_reserve(__pa(_stext), _end - _stext);
34+
memblock_reserve(__pa(_start), _end - _start);
3535

3636
early_init_fdt_reserve_self();
3737
early_init_fdt_scan_reserved_mem();
@@ -78,7 +78,7 @@ void __init setup_arch(char **cmdline_p)
7878
pr_info("Phys. mem: %ldMB\n",
7979
(unsigned long) memblock_phys_mem_size()/1024/1024);
8080

81-
setup_initial_init_mm(_stext, _etext, _edata, _end);
81+
setup_initial_init_mm(_start, _etext, _edata, _end);
8282

8383
parse_early_param();
8484

arch/csky/kernel/vmlinux.lds.S

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ SECTIONS
2222
{
2323
. = PAGE_OFFSET + PHYS_OFFSET_OFFSET;
2424

25-
_stext = .;
25+
_start = .;
2626
__init_begin = .;
2727
HEAD_TEXT_SECTION
2828
INIT_TEXT_SECTION(PAGE_SIZE)
@@ -33,6 +33,7 @@ SECTIONS
3333

3434
.text : AT(ADDR(.text) - LOAD_OFFSET) {
3535
_text = .;
36+
_stext = .;
3637
VBR_BASE
3738
IRQENTRY_TEXT
3839
SOFTIRQENTRY_TEXT

0 commit comments

Comments
 (0)