UML: normalize global variables exported by vmlinux.lds

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

1) Use _text to mark the start of the kernel image including the head
text, and _stext to mark the start of the .text section.
2) Export mandatory global variables __bss_stop.
3) Adjust __init_begin and __init_end to avoid acrossing .text and
   .data sections.

Change-Id: I8e9946f8df9a66e8134c046c84c9353b124cd739
Signed-off-by: Jiang Liu <jiang.liu@huawei.com>
Cc: Jeff Dike <jdike@addtoit.com>
Cc: Richard Weinberger <richard@nod.at>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Git commit: a214a8c68bcdef2fb0803425f7fe36fe41030d3f
Git repo: https://github.com/torvalds/linux.git
Signed-off-by: Lingutla Chandrasekhar <clingutla@codeaurora.org>
This commit is contained in:
Jiang Liu 2013-07-03 15:03:40 -07:00 committed by Gerrit - the friendly Code Review server
parent 40e1dcf551
commit d8a77fe672
3 changed files with 9 additions and 5 deletions

View File

@ -57,7 +57,6 @@
*(.uml.initcall.init)
__uml_initcall_end = .;
}
__init_end = .;
SECURITY_INIT

View File

@ -14,8 +14,6 @@ SECTIONS
__binary_start = .;
. = ALIGN(4096); /* Init code and data */
_text = .;
_stext = .;
__init_begin = .;
INIT_TEXT_SECTION(PAGE_SIZE)
. = ALIGN(PAGE_SIZE);
@ -67,6 +65,7 @@ SECTIONS
} =0x90909090
.plt : { *(.plt) }
.text : {
_stext = .;
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@ -91,7 +90,9 @@ SECTIONS
#include <asm/common.lds.S>
__init_begin = .;
init.data : { INIT_DATA }
__init_end = .;
/* Ensure the __preinit_array_start label is properly aligned. We
could instead move the label definition inside the section, but
@ -155,6 +156,7 @@ SECTIONS
. = ALIGN(32 / 8);
. = ALIGN(32 / 8);
}
__bss_stop = .;
_end = .;
PROVIDE (end = .);

View File

@ -20,13 +20,12 @@ SECTIONS
. = START + SIZEOF_HEADERS;
_text = .;
_stext = .;
__init_begin = .;
INIT_TEXT_SECTION(0)
. = ALIGN(PAGE_SIZE);
.text :
{
_stext = .;
TEXT_TEXT
SCHED_TEXT
LOCK_TEXT
@ -62,7 +61,10 @@ SECTIONS
#include <asm/common.lds.S>
__init_begin = .;
init.data : { INIT_DATA }
__init_end = .;
.data :
{
INIT_TASK_DATA(KERNEL_STACK_SIZE)
@ -97,6 +99,7 @@ SECTIONS
PROVIDE(_bss_start = .);
SBSS(0)
BSS(0)
__bss_stop = .;
_end = .;
PROVIDE (end = .);