Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Jiang Liu and committed by
Linus Torvalds
a214a8c6 40a3b8df

+9 -5
-1
arch/um/include/asm/common.lds.S
··· 57 57 *(.uml.initcall.init) 58 58 __uml_initcall_end = .; 59 59 } 60 - __init_end = .; 61 60 62 61 SECURITY_INIT 63 62
+4 -2
arch/um/kernel/dyn.lds.S
··· 14 14 __binary_start = .; 15 15 . = ALIGN(4096); /* Init code and data */ 16 16 _text = .; 17 - _stext = .; 18 - __init_begin = .; 19 17 INIT_TEXT_SECTION(PAGE_SIZE) 20 18 21 19 . = ALIGN(PAGE_SIZE); ··· 65 67 } =0x90909090 66 68 .plt : { *(.plt) } 67 69 .text : { 70 + _stext = .; 68 71 TEXT_TEXT 69 72 SCHED_TEXT 70 73 LOCK_TEXT ··· 90 91 91 92 #include <asm/common.lds.S> 92 93 94 + __init_begin = .; 93 95 init.data : { INIT_DATA } 96 + __init_end = .; 94 97 95 98 /* Ensure the __preinit_array_start label is properly aligned. We 96 99 could instead move the label definition inside the section, but ··· 156 155 . = ALIGN(32 / 8); 157 156 . = ALIGN(32 / 8); 158 157 } 158 + __bss_stop = .; 159 159 _end = .; 160 160 PROVIDE (end = .); 161 161
+5 -2
arch/um/kernel/uml.lds.S
··· 20 20 . = START + SIZEOF_HEADERS; 21 21 22 22 _text = .; 23 - _stext = .; 24 - __init_begin = .; 25 23 INIT_TEXT_SECTION(0) 26 24 . = ALIGN(PAGE_SIZE); 27 25 28 26 .text : 29 27 { 28 + _stext = .; 30 29 TEXT_TEXT 31 30 SCHED_TEXT 32 31 LOCK_TEXT ··· 61 62 62 63 #include <asm/common.lds.S> 63 64 65 + __init_begin = .; 64 66 init.data : { INIT_DATA } 67 + __init_end = .; 68 + 65 69 .data : 66 70 { 67 71 INIT_TASK_DATA(KERNEL_STACK_SIZE) ··· 99 97 PROVIDE(_bss_start = .); 100 98 SBSS(0) 101 99 BSS(0) 100 + __bss_stop = .; 102 101 _end = .; 103 102 PROVIDE (end = .); 104 103