Skip to content

Commit 14c4a53

Browse files
keesRussell King
authored andcommitted
ARM: 8583/1: mm: fix location of _etext
The _etext position is defined to be the end of the kernel text code, and should not include any part of the data segments. This interferes with things that might check memory ranges and expect executable code up to _etext. Just to be conservative, leave the kernel resource as it was, using __init_begin instead of _etext as the end mark. Signed-off-by: Kees Cook <[email protected]> Signed-off-by: Russell King <[email protected]>
1 parent 520319d commit 14c4a53

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

arch/arm/kernel/setup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -844,7 +844,7 @@ static void __init request_standard_resources(const struct machine_desc *mdesc)
844844
struct resource *res;
845845

846846
kernel_code.start = virt_to_phys(_text);
847-
kernel_code.end = virt_to_phys(_etext - 1);
847+
kernel_code.end = virt_to_phys(__init_begin - 1);
848848
kernel_data.start = virt_to_phys(_sdata);
849849
kernel_data.end = virt_to_phys(_end - 1);
850850

arch/arm/kernel/vmlinux.lds.S

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,8 @@ SECTIONS
125125
#ifdef CONFIG_DEBUG_ALIGN_RODATA
126126
. = ALIGN(1<<SECTION_SHIFT);
127127
#endif
128+
_etext = .; /* End of text section */
129+
128130
RO_DATA(PAGE_SIZE)
129131

130132
. = ALIGN(4);
@@ -155,8 +157,6 @@ SECTIONS
155157

156158
NOTES
157159

158-
_etext = .; /* End of text and rodata section */
159-
160160
#ifdef CONFIG_DEBUG_RODATA
161161
. = ALIGN(1<<SECTION_SHIFT);
162162
#else

0 commit comments

Comments
 (0)