Merge branch 'x86/numa' into x86/devel
[pandora-kernel.git] / arch / x86 / kernel / vmlinux_32.lds.S
1 /* ld script to make i386 Linux kernel
2  * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz>;
3  *
4  * Don't define absolute symbols until and unless you know that symbol
5  * value is should remain constant even if kernel image is relocated
6  * at run time. Absolute symbols are not relocated. If symbol value should
7  * change if kernel is relocated, make the symbol section relative and
8  * put it inside the section definition.
9  */
10
11 #define LOAD_OFFSET __PAGE_OFFSET
12
13 #include <asm-generic/vmlinux.lds.h>
14 #include <asm/thread_info.h>
15 #include <asm/page.h>
16 #include <asm/cache.h>
17 #include <asm/boot.h>
18
19 OUTPUT_FORMAT("elf32-i386", "elf32-i386", "elf32-i386")
20 OUTPUT_ARCH(i386)
21 ENTRY(phys_startup_32)
22 jiffies = jiffies_64;
23
24 PHDRS {
25         text PT_LOAD FLAGS(5);  /* R_E */
26         data PT_LOAD FLAGS(7);  /* RWE */
27         note PT_NOTE FLAGS(0);  /* ___ */
28 }
29 SECTIONS
30 {
31   . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
32   phys_startup_32 = startup_32 - LOAD_OFFSET;
33
34   .text.head : AT(ADDR(.text.head) - LOAD_OFFSET) {
35         _text = .;                      /* Text and read-only data */
36         *(.text.head)
37   } :text = 0x9090
38
39   /* read-only */
40   .text : AT(ADDR(.text) - LOAD_OFFSET) {
41         . = ALIGN(PAGE_SIZE); /* not really needed, already page aligned */
42         *(.text.page_aligned)
43         TEXT_TEXT
44         SCHED_TEXT
45         LOCK_TEXT
46         KPROBES_TEXT
47         *(.fixup)
48         *(.gnu.warning)
49         _etext = .;                     /* End of text section */
50   } :text = 0x9090
51
52   . = ALIGN(16);                /* Exception table */
53   __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
54         __start___ex_table = .;
55          *(__ex_table)
56         __stop___ex_table = .;
57   }
58
59   NOTES :text :note
60
61   BUG_TABLE :text
62
63   RODATA
64
65   /* writeable */
66   . = ALIGN(PAGE_SIZE);
67   .data : AT(ADDR(.data) - LOAD_OFFSET) {       /* Data */
68         DATA_DATA
69         CONSTRUCTORS
70         } :data
71
72   . = ALIGN(PAGE_SIZE);
73   .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
74         __nosave_begin = .;
75         *(.data.nosave)
76         . = ALIGN(PAGE_SIZE);
77         __nosave_end = .;
78   }
79
80   . = ALIGN(PAGE_SIZE);
81   .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
82         *(.data.page_aligned)
83         *(.data.idt)
84   }
85
86   . = ALIGN(32);
87   .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
88         *(.data.cacheline_aligned)
89   }
90
91   /* rarely changed data like cpu maps */
92   . = ALIGN(32);
93   .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
94         *(.data.read_mostly)
95         _edata = .;             /* End of data section */
96   }
97
98   . = ALIGN(THREAD_SIZE);       /* init_task */
99   .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
100         *(.data.init_task)
101   }
102
103   /* might get freed after init */
104   . = ALIGN(PAGE_SIZE);
105   .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
106         __smp_locks = .;
107         *(.smp_locks)
108         __smp_locks_end = .;
109   }
110   /* will be freed after init
111    * Following ALIGN() is required to make sure no other data falls on the
112    * same page where __smp_alt_end is pointing as that page might be freed
113    * after boot. Always make sure that ALIGN() directive is present after
114    * the section which contains __smp_alt_end.
115    */
116   . = ALIGN(PAGE_SIZE);
117
118   /* will be freed after init */
119   . = ALIGN(PAGE_SIZE);         /* Init code and data */
120   .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
121         __init_begin = .;
122         _sinittext = .;
123         INIT_TEXT
124         _einittext = .;
125   }
126   .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) {
127         INIT_DATA
128   }
129   . = ALIGN(16);
130   .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
131         __setup_start = .;
132         *(.init.setup)
133         __setup_end = .;
134    }
135   .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
136         __initcall_start = .;
137         INITCALLS
138         __initcall_end = .;
139   }
140   .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
141         __con_initcall_start = .;
142         *(.con_initcall.init)
143         __con_initcall_end = .;
144   }
145   .x86cpuvendor.init : AT(ADDR(.x86cpuvendor.init) - LOAD_OFFSET) {
146         __x86cpuvendor_start = .;
147         *(.x86cpuvendor.init)
148         __x86cpuvendor_end = .;
149   }
150   SECURITY_INIT
151   . = ALIGN(4);
152   .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
153         __alt_instructions = .;
154         *(.altinstructions)
155         __alt_instructions_end = .;
156   }
157   .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
158         *(.altinstr_replacement)
159   }
160   . = ALIGN(4);
161   .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
162         __parainstructions = .;
163         *(.parainstructions)
164         __parainstructions_end = .;
165   }
166   /* .exit.text is discard at runtime, not link time, to deal with references
167      from .altinstructions and .eh_frame */
168   .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) {
169         EXIT_TEXT
170   }
171   .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) {
172         EXIT_DATA
173   }
174 #if defined(CONFIG_BLK_DEV_INITRD)
175   . = ALIGN(PAGE_SIZE);
176   .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
177         __initramfs_start = .;
178         *(.init.ramfs)
179         __initramfs_end = .;
180   }
181 #endif
182   . = ALIGN(PAGE_SIZE);
183   .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
184         __per_cpu_start = .;
185         *(.data.percpu)
186         *(.data.percpu.shared_aligned)
187         __per_cpu_end = .;
188   }
189   . = ALIGN(PAGE_SIZE);
190   /* freed after init ends here */
191
192   .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
193         __init_end = .;
194         __bss_start = .;                /* BSS */
195         *(.bss.page_aligned)
196         *(.bss)
197         . = ALIGN(4);
198         __bss_stop = .;
199         _end = . ;
200         /* This is where the kernel creates the early boot page tables */
201         . = ALIGN(PAGE_SIZE);
202         pg0 = . ;
203   }
204
205   /* Sections to be discarded */
206   /DISCARD/ : {
207         *(.exitcall.exit)
208         }
209
210   STABS_DEBUG
211
212   DWARF_DEBUG
213 }