fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.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 _proxy_pda = 0;
30
31 PHDRS {
32         text PT_LOAD FLAGS(5);  /* R_E */
33         data PT_LOAD FLAGS(7);  /* RWE */
34         note PT_NOTE FLAGS(4);  /* R__ */
35 }
36 SECTIONS
37 {
38 /* xen i386 redefineds LOAD_OFFSET to zero on page.h
39    quintela@redhat.com */
40 #ifdef CONFIG_XEN
41   . = __PAGE_OFFSET + LOAD_PHYSICAL_ADDR;
42 #else
43   . = LOAD_OFFSET + LOAD_PHYSICAL_ADDR;
44 #endif
45   phys_startup_32 = startup_32 - LOAD_OFFSET;
46   /* read-only */
47   .text : AT(ADDR(.text) - LOAD_OFFSET) {
48         _text = .;                      /* Text and read-only data */
49         *(.text)
50         SCHED_TEXT
51         LOCK_TEXT
52         KPROBES_TEXT
53         *(.fixup)
54         *(.gnu.warning)
55         _etext = .;                     /* End of text section */
56   } :text = 0x9090
57
58   . = ALIGN(16);                /* Exception table */
59   __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) {
60         __start___ex_table = .;
61          *(__ex_table)
62         __stop___ex_table = .;
63   }
64
65   RODATA
66
67   BUG_TABLE
68
69   . = ALIGN(4);
70   .tracedata : AT(ADDR(.tracedata) - LOAD_OFFSET) {
71         __tracedata_start = .;
72         *(.tracedata)
73         __tracedata_end = .;
74   }
75
76   . = ALIGN(4096);
77   /* writeable */
78   . = ALIGN(4096);
79   .data : AT(ADDR(.data) - LOAD_OFFSET) {       /* Data */
80         *(.data)
81         CONSTRUCTORS
82         } :data
83
84   .paravirtprobe : AT(ADDR(.paravirtprobe) - LOAD_OFFSET) {
85         __start_paravirtprobe = .;
86         *(.paravirtprobe)
87         __stop_paravirtprobe = .;
88   }
89
90   . = ALIGN(4096);
91   .data_nosave : AT(ADDR(.data_nosave) - LOAD_OFFSET) {
92         __nosave_begin = .;
93         *(.data.nosave)
94         . = ALIGN(4096);
95         __nosave_end = .;
96   }
97
98   . = ALIGN(4096);
99   .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET) {
100         *(.data.idt)
101   }
102
103   . = ALIGN(32);
104   .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET) {
105         *(.data.cacheline_aligned)
106   }
107
108   /* rarely changed data like cpu maps */
109   . = ALIGN(32);
110   .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET) {
111         *(.data.read_mostly)
112         _edata = .;             /* End of data section */
113   }
114
115   . = ALIGN(THREAD_SIZE);       /* init_task */
116   .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET) {
117         *(.data.init_task)
118   }
119
120   /* might get freed after init */
121   . = ALIGN(4096);
122   .smp_altinstructions : AT(ADDR(.smp_altinstructions) - LOAD_OFFSET) {
123         __smp_alt_begin = .;
124         __smp_alt_instructions = .;
125         *(.smp_altinstructions)
126         __smp_alt_instructions_end = .;
127   }
128   . = ALIGN(4);
129   .smp_locks : AT(ADDR(.smp_locks) - LOAD_OFFSET) {
130         __smp_locks = .;
131         *(.smp_locks)
132         __smp_locks_end = .;
133   }
134   .smp_altinstr_replacement : AT(ADDR(.smp_altinstr_replacement) - LOAD_OFFSET) {
135         *(.smp_altinstr_replacement)
136         __smp_alt_end = .;
137   }
138   /* will be freed after init
139    * Following ALIGN() is required to make sure no other data falls on the
140    * same page where __smp_alt_end is pointing as that page might be freed
141    * after boot. Always make sure that ALIGN() directive is present after
142    * the section which contains __smp_alt_end.
143    */
144   . = ALIGN(4096);
145
146   /* will be freed after init */
147   . = ALIGN(4096);              /* Init code and data */
148   .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) {
149         __init_begin = .;
150         _sinittext = .;
151         *(.init.text)
152         _einittext = .;
153   }
154   .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) { *(.init.data) }
155   . = ALIGN(16);
156   .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET) {
157         __setup_start = .;
158         *(.init.setup)
159         __setup_end = .;
160    }
161   .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET) {
162         __initcall_start = .;
163         INITCALLS
164         __initcall_end = .;
165   }
166   .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET) {
167         __con_initcall_start = .;
168         *(.con_initcall.init)
169         __con_initcall_end = .;
170   }
171   SECURITY_INIT
172   . = ALIGN(4);
173   .altinstructions : AT(ADDR(.altinstructions) - LOAD_OFFSET) {
174         __alt_instructions = .;
175         *(.altinstructions)
176         __alt_instructions_end = .;
177   }
178   .altinstr_replacement : AT(ADDR(.altinstr_replacement) - LOAD_OFFSET) {
179         *(.altinstr_replacement)
180   }
181   . = ALIGN(4);
182   .parainstructions : AT(ADDR(.parainstructions) - LOAD_OFFSET) {
183         __start_parainstructions = .;
184         *(.parainstructions)
185         __stop_parainstructions = .;
186   }
187   /* .exit.text is discard at runtime, not link time, to deal with references
188      from .altinstructions and .eh_frame */
189   .exit.text : AT(ADDR(.exit.text) - LOAD_OFFSET) { *(.exit.text) }
190   .exit.data : AT(ADDR(.exit.data) - LOAD_OFFSET) { *(.exit.data) }
191   . = ALIGN(4096);
192   .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) {
193         __initramfs_start = .;
194         *(.init.ramfs)
195         __initramfs_end = .;
196   }
197   . = ALIGN(L1_CACHE_BYTES);
198   .data.percpu  : AT(ADDR(.data.percpu) - LOAD_OFFSET) {
199         __per_cpu_start = .;
200         *(.data.percpu)
201         __per_cpu_end = .;
202   }
203   . = ALIGN(4096);
204   /* freed after init ends here */
205         
206   .bss : AT(ADDR(.bss) - LOAD_OFFSET) {
207         __init_end = .;
208         __bss_start = .;                /* BSS */
209         *(.bss.page_aligned)
210         *(.bss)
211         . = ALIGN(4);
212         __bss_stop = .;
213         _end = . ;
214         /* This is where the kernel creates the early boot page tables */
215         . = ALIGN(4096);
216         pg0 = . ;
217   }
218
219   /* Sections to be discarded */
220   /DISCARD/ : {
221         *(.exitcall.exit)
222         }
223
224   STABS_DEBUG
225
226   DWARF_DEBUG
227
228   NOTES
229 }