Skip to content

Commit a214a8c

Browse files
jiangliutorvalds
authored andcommitted
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. 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>
1 parent 40a3b8d commit a214a8c

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

‎arch/um/include/asm/common.lds.S‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,6 @@
5757
*(.uml.initcall.init)
5858
__uml_initcall_end = .;
5959
}
60-
__init_end = .;
6160

6261
SECURITY_INIT
6362

‎arch/um/kernel/dyn.lds.S‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,6 @@ SECTIONS
1414
__binary_start = .;
1515
. = ALIGN(4096); /* Init code and data */
1616
_text = .;
17-
_stext = .;
18-
__init_begin = .;
1917
INIT_TEXT_SECTION(PAGE_SIZE)
2018

2119
. = ALIGN(PAGE_SIZE);
@@ -67,6 +65,7 @@ SECTIONS
6765
} =0x90909090
6866
.plt : { *(.plt) }
6967
.text : {
68+
_stext = .;
7069
TEXT_TEXT
7170
SCHED_TEXT
7271
LOCK_TEXT
@@ -91,7 +90,9 @@ SECTIONS
9190

9291
#include <asm/common.lds.S>
9392

93+
__init_begin = .;
9494
init.data : { INIT_DATA }
95+
__init_end = .;
9596

9697
/* Ensure the __preinit_array_start label is properly aligned. We
9798
could instead move the label definition inside the section, but
@@ -155,6 +156,7 @@ SECTIONS
155156
. = ALIGN(32 / 8);
156157
. = ALIGN(32 / 8);
157158
}
159+
__bss_stop = .;
158160
_end = .;
159161
PROVIDE (end = .);
160162

‎arch/um/kernel/uml.lds.S‎

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,12 @@ SECTIONS
2020
. = START + SIZEOF_HEADERS;
2121

2222
_text = .;
23-
_stext = .;
24-
__init_begin = .;
2523
INIT_TEXT_SECTION(0)
2624
. = ALIGN(PAGE_SIZE);
2725

2826
.text :
2927
{
28+
_stext = .;
3029
TEXT_TEXT
3130
SCHED_TEXT
3231
LOCK_TEXT
@@ -62,7 +61,10 @@ SECTIONS
6261

6362
#include <asm/common.lds.S>
6463

64+
__init_begin = .;
6565
init.data : { INIT_DATA }
66+
__init_end = .;
67+
6668
.data :
6769
{
6870
INIT_TASK_DATA(KERNEL_STACK_SIZE)
@@ -97,6 +99,7 @@ SECTIONS
9799
PROVIDE(_bss_start = .);
98100
SBSS(0)
99101
BSS(0)
102+
__bss_stop = .;
100103
_end = .;
101104
PROVIDE (end = .);
102105

0 commit comments

Comments
 (0)