diff options
author | Arjan van de Ven <arjan@linux.intel.com> | 2006-03-25 10:30:28 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-25 12:10:55 -0500 |
commit | eaeae0cc985fa1df753da7edc8d02635cbc1ba39 (patch) | |
tree | 793319d36cf4c16d0374ab915b3225cc073c3d26 | |
parent | 5f44a669805ab2c18b347436ec5333173b821268 (diff) |
[PATCH] x86_64: Patch to make the head.S-must-be-first-in-vmlinux order explicit
This patch puts the code from head.S in a special .bootstrap.text
section.
I'm working on a patch to reorder the functions in the kernel (I'll post
that later), but for x86-64 at least the kernel bootstrap requires that
the head.S functions are on the very first page/pages of the kernel
text. This is understandable since the bootstrap is complex enough
already and not a problem at all, it just means they aren't allowed to
be reordered. This patch puts these special functions into a separate
section to document this, and to guarantee this in the light of possibly
reordering the rest later.
(So this patch doesn't fix a bug per se, but makes things more robust by
making the order of these functions explicit)
Signed-off-by: Arjan van de Ven <arjan@linux.intel.com>
Signed-off-by: Andi Kleen <ak@suse.de>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
-rw-r--r-- | arch/x86_64/kernel/head.S | 1 | ||||
-rw-r--r-- | arch/x86_64/kernel/vmlinux.lds.S | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/x86_64/kernel/head.S b/arch/x86_64/kernel/head.S index 0cddcc038422..6df05e6034fa 100644 --- a/arch/x86_64/kernel/head.S +++ b/arch/x86_64/kernel/head.S | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | 27 | ||
28 | .text | 28 | .text |
29 | .section .bootstrap.text | ||
29 | .code32 | 30 | .code32 |
30 | .globl startup_32 | 31 | .globl startup_32 |
31 | /* %bx: 1 if coming from smp trampoline on secondary cpu */ | 32 | /* %bx: 1 if coming from smp trampoline on secondary cpu */ |
diff --git a/arch/x86_64/kernel/vmlinux.lds.S b/arch/x86_64/kernel/vmlinux.lds.S index 74db0062d4a2..029be20accef 100644 --- a/arch/x86_64/kernel/vmlinux.lds.S +++ b/arch/x86_64/kernel/vmlinux.lds.S | |||
@@ -20,6 +20,7 @@ SECTIONS | |||
20 | phys_startup_64 = startup_64 - LOAD_OFFSET; | 20 | phys_startup_64 = startup_64 - LOAD_OFFSET; |
21 | _text = .; /* Text and read-only data */ | 21 | _text = .; /* Text and read-only data */ |
22 | .text : AT(ADDR(.text) - LOAD_OFFSET) { | 22 | .text : AT(ADDR(.text) - LOAD_OFFSET) { |
23 | *(.bootstrap.text) | ||
23 | *(.text) | 24 | *(.text) |
24 | SCHED_TEXT | 25 | SCHED_TEXT |
25 | LOCK_TEXT | 26 | LOCK_TEXT |