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