diff options
author | Sam Ravnborg <sam@ravnborg.org> | 2009-04-29 03:47:21 -0400 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2009-04-29 04:20:31 -0400 |
commit | dfc20895d944cfa81d8ff00809b68ecb8f72cbb0 (patch) | |
tree | 1494f69d70ce845e15415a13733d3b89827d4264 /arch/x86/kernel/vmlinux.lds.S | |
parent | 444e0ae4831f99ba25062d9a5ccb7117c62841a0 (diff) |
x86, vmlinux.lds: unify .text output sections
32 bit x86 had a dedicated .text.head output section,
whereas 64 bit had it all in a single output section.
In the unified version the dedicated .text.head output section
was kept to have full control over the head code.
32 bit:
- Moved definition of _stext to the linker script.
The definition is located _after_ .text.page_aligned as this
is what 32 bit did before.
The ALIGN(8) was introduced so we hit the exact same address
(on the tested config) before and after the move.
I assume that it is a bug that _stext did not cover the
.text.page_aligned section - if this is true it can be fixed
in a follow-up patch (and the ugly ALIGN() can be dropped).
[ Impact: 64-bit: cleanup, 32-bit: use the 64-bit linker script ]
Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Tim Abbott <tabbott@MIT.EDU>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
LKML-Reference: <1240991249-27117-5-git-send-email-sam@ravnborg.org>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/vmlinux.lds.S')
-rw-r--r-- | arch/x86/kernel/vmlinux.lds.S | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/arch/x86/kernel/vmlinux.lds.S b/arch/x86/kernel/vmlinux.lds.S index 845776fe5298..a7c88bb43650 100644 --- a/arch/x86/kernel/vmlinux.lds.S +++ b/arch/x86/kernel/vmlinux.lds.S | |||
@@ -64,6 +64,37 @@ SECTIONS | |||
64 | phys_startup_64 = startup_64 - LOAD_OFFSET; | 64 | phys_startup_64 = startup_64 - LOAD_OFFSET; |
65 | #endif | 65 | #endif |
66 | 66 | ||
67 | /* Text and read-only data */ | ||
68 | |||
69 | /* bootstrapping code */ | ||
70 | .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) { | ||
71 | _text = .; | ||
72 | *(.text.head) | ||
73 | } :text = 0x9090 | ||
74 | |||
75 | /* The rest of the text */ | ||
76 | .text : AT(ADDR(.text) - LOAD_OFFSET) { | ||
77 | #ifdef CONFIG_X86_32 | ||
78 | /* not really needed, already page aligned */ | ||
79 | . = ALIGN(PAGE_SIZE); | ||
80 | *(.text.page_aligned) | ||
81 | #endif | ||
82 | . = ALIGN(8); | ||
83 | _stext = .; | ||
84 | TEXT_TEXT | ||
85 | SCHED_TEXT | ||
86 | LOCK_TEXT | ||
87 | KPROBES_TEXT | ||
88 | IRQENTRY_TEXT | ||
89 | *(.fixup) | ||
90 | *(.gnu.warning) | ||
91 | /* End of text section */ | ||
92 | _etext = .; | ||
93 | } :text = 0x9090 | ||
94 | |||
95 | NOTES :text :note | ||
96 | |||
97 | |||
67 | #ifdef CONFIG_X86_32 | 98 | #ifdef CONFIG_X86_32 |
68 | # include "vmlinux_32.lds.S" | 99 | # include "vmlinux_32.lds.S" |
69 | #else | 100 | #else |