diff options
author | Russell King <rmk@dyn-67.arm.linux.org.uk> | 2007-05-08 10:15:45 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2007-05-08 10:15:45 -0400 |
commit | 08fdffd4cf4ddd4eb4b32e78f93f4ff53ccec78f (patch) | |
tree | edbce85f683fcc327f3552b208c954a9d12e704a /arch/arm/kernel | |
parent | 4efb4482729d2cc7926f49f997a28370e701073f (diff) |
[ARM] Ensure head text is always placed at the start of kernel
Commit 86c0baf123e474b6eb404798926ecf62b426bf3a highlighted that we
may end up with the head text placed elsewhere in the kernel image.
Introduce a new .text.head section to contain the initial kernel
startup code, and always place this section at the beginning of the
kernel image.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/kernel')
-rw-r--r-- | arch/arm/kernel/head-nommu.S | 2 | ||||
-rw-r--r-- | arch/arm/kernel/head.S | 2 | ||||
-rw-r--r-- | arch/arm/kernel/vmlinux.lds.S | 10 |
3 files changed, 9 insertions, 5 deletions
diff --git a/arch/arm/kernel/head-nommu.S b/arch/arm/kernel/head-nommu.S index 0119c0d5f978..5d78ffb8a9a7 100644 --- a/arch/arm/kernel/head-nommu.S +++ b/arch/arm/kernel/head-nommu.S | |||
@@ -33,7 +33,7 @@ | |||
33 | * numbers for r1. | 33 | * numbers for r1. |
34 | * | 34 | * |
35 | */ | 35 | */ |
36 | __INIT | 36 | .section ".text.head", "ax" |
37 | .type stext, %function | 37 | .type stext, %function |
38 | ENTRY(stext) | 38 | ENTRY(stext) |
39 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode | 39 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode |
diff --git a/arch/arm/kernel/head.S b/arch/arm/kernel/head.S index 1d35edacc011..41f98b4ba2ee 100644 --- a/arch/arm/kernel/head.S +++ b/arch/arm/kernel/head.S | |||
@@ -73,7 +73,7 @@ | |||
73 | * crap here - that's what the boot loader (or in extreme, well justified | 73 | * crap here - that's what the boot loader (or in extreme, well justified |
74 | * circumstances, zImage) is for. | 74 | * circumstances, zImage) is for. |
75 | */ | 75 | */ |
76 | __INIT | 76 | .section ".text.head", "ax" |
77 | .type stext, %function | 77 | .type stext, %function |
78 | ENTRY(stext) | 78 | ENTRY(stext) |
79 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode | 79 | msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode |
diff --git a/arch/arm/kernel/vmlinux.lds.S b/arch/arm/kernel/vmlinux.lds.S index faf32de5c5ad..e4156e7868ce 100644 --- a/arch/arm/kernel/vmlinux.lds.S +++ b/arch/arm/kernel/vmlinux.lds.S | |||
@@ -23,11 +23,15 @@ SECTIONS | |||
23 | #else | 23 | #else |
24 | . = PAGE_OFFSET + TEXT_OFFSET; | 24 | . = PAGE_OFFSET + TEXT_OFFSET; |
25 | #endif | 25 | #endif |
26 | .init : { /* Init code and data */ | 26 | .text.head : { |
27 | _stext = .; | 27 | _stext = .; |
28 | _sinittext = .; | 28 | _sinittext = .; |
29 | *(.text.head) | ||
30 | } | ||
31 | |||
32 | .init : { /* Init code and data */ | ||
29 | *(.init.text) | 33 | *(.init.text) |
30 | _einittext = .; | 34 | _einittext = .; |
31 | __proc_info_begin = .; | 35 | __proc_info_begin = .; |
32 | *(.proc.info.init) | 36 | *(.proc.info.init) |
33 | __proc_info_end = .; | 37 | __proc_info_end = .; |