Commit 06256f8f authored by Jiang Liu's avatar Jiang Liu Committed by Linus Torvalds

c6x: normalize global variables exported by vmlinux.lds

Normalize global variables exported by vmlinux.lds to conform usage
guidelines from include/asm-generic/sections.h.

Use _text to mark the start of the kernel image including the head text,
and _stext to mark the start of the .text section.

This patch also fixes possible bugs due to current address layout that
[__init_begin, __init_end] is a sub-range of [_stext, _etext] and pages
within range [__init_begin, __init_end] will be freed by free_initmem().
Signed-off-by: default avatarJiang Liu <jiang.liu@huawei.com>
Cc: Mark Salter <msalter@redhat.com>
Cc: Aurelien Jacquiot <a-jacquiot@ti.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 2e555f8d
...@@ -54,16 +54,15 @@ SECTIONS ...@@ -54,16 +54,15 @@ SECTIONS
} }
. = ALIGN(PAGE_SIZE); . = ALIGN(PAGE_SIZE);
__init_begin = .;
.init : .init :
{ {
_stext = .;
_sinittext = .; _sinittext = .;
HEAD_TEXT HEAD_TEXT
INIT_TEXT INIT_TEXT
_einittext = .; _einittext = .;
} }
__init_begin = _stext;
INIT_DATA_SECTION(16) INIT_DATA_SECTION(16)
PERCPU_SECTION(128) PERCPU_SECTION(128)
...@@ -74,6 +73,7 @@ SECTIONS ...@@ -74,6 +73,7 @@ SECTIONS
.text : .text :
{ {
_text = .; _text = .;
_stext = .;
TEXT_TEXT TEXT_TEXT
SCHED_TEXT SCHED_TEXT
LOCK_TEXT LOCK_TEXT
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment