mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-12 16:58:53 +00:00
[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>
This commit is contained in:
parent
4efb448272
commit
08fdffd4cf
@ -33,7 +33,7 @@
|
|||||||
* numbers for r1.
|
* numbers for r1.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
__INIT
|
.section ".text.head", "ax"
|
||||||
.type stext, %function
|
.type stext, %function
|
||||||
ENTRY(stext)
|
ENTRY(stext)
|
||||||
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
|
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
|
||||||
|
@ -73,7 +73,7 @@
|
|||||||
* crap here - that's what the boot loader (or in extreme, well justified
|
* crap here - that's what the boot loader (or in extreme, well justified
|
||||||
* circumstances, zImage) is for.
|
* circumstances, zImage) is for.
|
||||||
*/
|
*/
|
||||||
__INIT
|
.section ".text.head", "ax"
|
||||||
.type stext, %function
|
.type stext, %function
|
||||||
ENTRY(stext)
|
ENTRY(stext)
|
||||||
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
|
msr cpsr_c, #PSR_F_BIT | PSR_I_BIT | SVC_MODE @ ensure svc mode
|
||||||
|
@ -23,9 +23,13 @@ SECTIONS
|
|||||||
#else
|
#else
|
||||||
. = PAGE_OFFSET + TEXT_OFFSET;
|
. = PAGE_OFFSET + TEXT_OFFSET;
|
||||||
#endif
|
#endif
|
||||||
.init : { /* Init code and data */
|
.text.head : {
|
||||||
_stext = .;
|
_stext = .;
|
||||||
_sinittext = .;
|
_sinittext = .;
|
||||||
|
*(.text.head)
|
||||||
|
}
|
||||||
|
|
||||||
|
.init : { /* Init code and data */
|
||||||
*(.init.text)
|
*(.init.text)
|
||||||
_einittext = .;
|
_einittext = .;
|
||||||
__proc_info_begin = .;
|
__proc_info_begin = .;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user