]> err.no Git - linux-2.6/blob - arch/i386/kernel/vmlinux.lds.S
Merge git://git.kernel.org/pub/scm/linux/kernel/git/sfrench/cifs-2.6
[linux-2.6] / 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   BUG_TABLE
61
62   . = ALIGN(4);
63   .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
64         __tracedata_start = .;
65         *(.tracedata)
66         __tracedata_end = .;
67   }
68
69   /* writeable */
70   . = ALIGN(4096);
71   .data : AT(ADDR(.data) - LOAD_OFFSET) {       /* Data */
72         *(.data)
73         CONSTRUCTORS
74         } :data
75
76   .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
77         __start_paravirtprobe = .;
78         *(.paravirtprobe)
79         __stop_paravirtprobe = .;
80   }
81
82   . = ALIGN(4096);
83   .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
84         __nosave_begin = .;
85         *(.data.nosave)
86         . = ALIGN(4096);
87         __nosave_end = .;
88   }
89
90   . = ALIGN(4096);
91   .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
92         *(.data.idt)
93   }
94
95   . = ALIGN(32);
96   .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
97         *(.data.cacheline_aligned)
98   }
99
100   /* rarely changed data like cpu maps */
101   . = ALIGN(32);
102   .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
103         *(.data.read_mostly)
104         _edata = .;             /* End of data section */
105   }
106
107   . = ALIGN(THREAD_SIZE);       /* init_task */
108   .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
109         *(.data.init_task)
110   }
111
112   /* might get freed after init */
113   . = ALIGN(4096);
114   .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
115         __smp_alt_begin = .;
116         __smp_alt_instructions = .;
117         *(.smp_altinstructions)
118         __smp_alt_instructions_end = .;
119   }
120   . = ALIGN(4);
121   .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
122         __smp_locks = .;
123         *(.smp_locks)
124         __smp_locks_end = .;
125   }
126   .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
127         *(.smp_altinstr_replacement)
128         __smp_alt_end = .;
129   }
130   /* will be freed after init
131    * Following ALIGN() is required to make sure no other data falls on the
132    * same page where __smp_alt_end is pointing as that page might be freed
133    * after boot. Always make sure that ALIGN() directive is present after
134    * the section which contains __smp_alt_end.
135    */
136   . = ALIGN(4096);
137
138   /* will be freed after init */
139   . = ALIGN(4096);              /* Init code and data */
140   .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
141         __init_begin = .;
142         _sinittext = .;
143         *(.init.text)
144         _einittext = .;
145   }
146   .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
147   . = ALIGN(16);
148   .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
149         __setup_start = .;
150         *(.init.setup)
151         __setup_end = .;
152    }
153   .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
154         __initcall_start = .;
155         INITCALLS
156         __initcall_end = .;
157   }
158   .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
159         __con_initcall_start = .;
160         *(.con_initcall.init)
161         __con_initcall_end = .;
162   }
163   SECURITY_INIT
164   . = ALIGN(4);
165   .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
166         __alt_instructions = .;
167         *(.altinstructions)
168         __alt_instructions_end = .;
169   }
170   .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
171         *(.altinstr_replacement)
172   }
173   . = ALIGN(4);
174   .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
175         __start_parainstructions = .;
176         *(.parainstructions)
177         __stop_parainstructions = .;
178   }
179   /* .exit.text is discard at runtime, not link time, to deal with references
180      from .altinstructions and .eh_frame */
181   .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
182   .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
183   . = ALIGN(4096);
184   .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
185         __initramfs_start = .;
186         *(.init.ramfs)
187         __initramfs_end = .;
188   }
189   . = ALIGN(L1_CACHE_BYTES);
190   .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
191         __per_cpu_start = .;
192         *(.data.percpu)
193         __per_cpu_end = .;
194   }
195   . = ALIGN(4096);
196   /* freed after init ends here */
197         
198   .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
199         __init_end = .;
200         __bss_start = .;                /* BSS */
201         *(.bss.page_aligned)
202         *(.bss)
203         . = ALIGN(4);
204         __bss_stop = .;
205         _end = . ;
206         /* This is where the kernel creates the early boot page tables */
207         . = ALIGN(4096);
208         pg0 = . ;
209   }
210
211   /* Sections to be discarded */
212   /DISCARD/ : {
213         *(.exitcall.exit)
214         }
215
216   STABS_DEBUG
217
218   DWARF_DEBUG
219
220   NOTES
221 }