blob: 794d168bc8a4ed9e21f1067a3ffcde76ee18faae [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2#include <asm/cache.h>
3#include <asm/ptrace.h>
4#include <asm/system.h>
5#include <asm/pgtable.h>
6
Linus Torvalds1da177e2005-04-16 15:20:36 -07007#include <asm-generic/vmlinux.lds.h>
8
Keshavamurthy Anil Sc7b645f2005-06-27 15:17:16 -07009#define IVT_TEXT \
10 VMLINUX_SYMBOL(__start_ivt_text) = .; \
11 *(.text.ivt) \
12 VMLINUX_SYMBOL(__end_ivt_text) = .;
13
Linus Torvalds1da177e2005-04-16 15:20:36 -070014OUTPUT_FORMAT("elf64-ia64-little")
15OUTPUT_ARCH(ia64)
16ENTRY(phys_start)
17jiffies = jiffies_64;
18PHDRS {
19 code PT_LOAD;
20 percpu PT_LOAD;
21 data PT_LOAD;
David Mosberger-Tang336cdba82007-08-09 11:53:15 -060022 note PT_NOTE;
David Mosberger-Tang9bf77d02007-08-09 19:58:52 -060023 unwind 0x70000001; /* PT_IA_64_UNWIND, but ld doesn't match the name */
Linus Torvalds1da177e2005-04-16 15:20:36 -070024}
25SECTIONS
26{
27 /* Sections to be discarded */
28 /DISCARD/ : {
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +010029 EXIT_TEXT
30 EXIT_DATA
Linus Torvalds1da177e2005-04-16 15:20:36 -070031 *(.exitcall.exit)
32 *(.IA_64.unwind.exit.text)
33 *(.IA_64.unwind_info.exit.text)
34 }
35
36 v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */
37 phys_start = _start - LOAD_OFFSET;
38
39 code : { } :code
40 . = KERNEL_START;
41
42 _text = .;
43 _stext = .;
44
45 .text : AT(ADDR(.text) - LOAD_OFFSET)
46 {
Keshavamurthy Anil Sc7b645f2005-06-27 15:17:16 -070047 IVT_TEXT
Sam Ravnborg76647092007-05-13 00:31:33 +020048 TEXT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070049 SCHED_TEXT
50 LOCK_TEXT
Prasanna S Panchamukhi1f7ad572005-09-06 15:19:30 -070051 KPROBES_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -070052 *(.gnu.linkonce.t*)
53 }
Tony Luck9d6f40b2007-07-20 14:39:24 -070054 .text.head : AT(ADDR(.text.head) - LOAD_OFFSET)
55 { *(.text.head) }
Linus Torvalds1da177e2005-04-16 15:20:36 -070056 .text2 : AT(ADDR(.text2) - LOAD_OFFSET)
57 { *(.text2) }
58#ifdef CONFIG_SMP
59 .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET)
60 { *(.text.lock) }
61#endif
62 _etext = .;
63
64 /* Read-only data */
65
David Mosberger-Tang336cdba82007-08-09 11:53:15 -060066 NOTES :code :note /* put .notes in text and mark in PT_NOTE */
67 code_continues : {} :code /* switch back to regular program... */
68
Linus Torvalds1da177e2005-04-16 15:20:36 -070069 /* Exception table */
70 . = ALIGN(16);
71 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET)
72 {
73 __start___ex_table = .;
74 *(__ex_table)
75 __stop___ex_table = .;
76 }
77
Russ Andersond89cfe72006-03-29 11:31:23 -060078 /* MCA table */
79 . = ALIGN(16);
80 __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET)
81 {
82 __start___mca_table = .;
83 *(__mca_table)
84 __stop___mca_table = .;
85 }
86
Chen, Kenneth Wa0776ec2006-10-13 10:05:45 -070087 .data.patch.phys_stack_reg : AT(ADDR(.data.patch.phys_stack_reg) - LOAD_OFFSET)
88 {
89 __start___phys_stack_reg_patchlist = .;
90 *(.data.patch.phys_stack_reg)
91 __end___phys_stack_reg_patchlist = .;
92 }
93
Linus Torvalds1da177e2005-04-16 15:20:36 -070094 /* Global data */
95 _data = .;
96
Linus Torvalds1da177e2005-04-16 15:20:36 -070097 /* Unwind info & table: */
98 . = ALIGN(8);
99 .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET)
100 { *(.IA_64.unwind_info*) }
101 .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET)
102 {
103 __start_unwind = .;
104 *(.IA_64.unwind*)
105 __end_unwind = .;
David Mosberger-Tang9bf77d02007-08-09 19:58:52 -0600106 } :code :unwind
107 code_continues2 : {} : code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700108
109 RODATA
110
111 .opd : AT(ADDR(.opd) - LOAD_OFFSET)
112 { *(.opd) }
113
114 /* Initialization code and data: */
115
116 . = ALIGN(PAGE_SIZE);
117 __init_begin = .;
118 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET)
119 {
120 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100121 INIT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700122 _einittext = .;
123 }
124
125 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET)
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100126 { INIT_DATA }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800128#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700129 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)
130 {
131 __initramfs_start = .;
132 *(.init.ramfs)
133 __initramfs_end = .;
134 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800135#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700136
137 . = ALIGN(16);
138 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET)
139 {
140 __setup_start = .;
141 *(.init.setup)
142 __setup_end = .;
143 }
144 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET)
145 {
146 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700147 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700148 __initcall_end = .;
149 }
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800150
151 .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
152 {
153 __start___vtop_patchlist = .;
154 *(.data.patch.vtop)
155 __end___vtop_patchlist = .;
156 }
157
Tony Luck4dcc29e2008-05-27 13:23:16 -0700158 .data.patch.rse : AT(ADDR(.data.patch.rse) - LOAD_OFFSET)
159 {
160 __start___rse_patchlist = .;
161 *(.data.patch.rse)
162 __end___rse_patchlist = .;
163 }
164
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800165 .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
166 {
167 __start___mckinley_e9_bundles = .;
168 *(.data.patch.mckinley_e9)
169 __end___mckinley_e9_bundles = .;
170 }
171
Isaku Yamahatabf7ab022009-03-04 21:06:51 +0900172#if defined(CONFIG_PARAVIRT)
173 . = ALIGN(16);
174 .paravirt_bundles : AT(ADDR(.paravirt_bundles) - LOAD_OFFSET)
175 {
176 __start_paravirt_bundles = .;
177 *(.paravirt_bundles)
178 __stop_paravirt_bundles = .;
179 }
180 . = ALIGN(16);
181 .paravirt_insts : AT(ADDR(.paravirt_insts) - LOAD_OFFSET)
182 {
183 __start_paravirt_insts = .;
184 *(.paravirt_insts)
185 __stop_paravirt_insts = .;
186 }
187 . = ALIGN(16);
188 .paravirt_branches : AT(ADDR(.paravirt_branches) - LOAD_OFFSET)
189 {
190 __start_paravirt_branches = .;
191 *(.paravirt_branches)
192 __stop_paravirt_branches = .;
193 }
194#endif
195
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800196#if defined(CONFIG_IA64_GENERIC)
197 /* Machine Vector */
198 . = ALIGN(16);
199 .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
200 {
201 machvec_start = .;
202 *(.machvec)
203 machvec_end = .;
204 }
205#endif
206
Kirill Korotaevd00195e2007-02-05 16:19:59 -0800207 . = ALIGN(8);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700208 __con_initcall_start = .;
209 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
210 { *(.con_initcall.init) }
211 __con_initcall_end = .;
212 __security_initcall_start = .;
213 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET)
214 { *(.security_initcall.init) }
215 __security_initcall_end = .;
216 . = ALIGN(PAGE_SIZE);
217 __init_end = .;
218
219 /* The initial task and kernel stack */
220 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
221 { *(.data.init_task) }
222
223 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
224 { *(__special_page_section)
225 __start_gate_section = .;
226 *(.data.gate)
227 __stop_gate_section = .;
Isaku Yamahatab937dd72009-03-04 21:05:43 +0900228#ifdef CONFIG_XEN
229 . = ALIGN(PAGE_SIZE);
230 __xen_start_gate_section = .;
231 *(.data.gate.xen)
232 __xen_stop_gate_section = .;
233#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700234 }
Al Stonedf8f0ec2006-08-12 11:08:12 -0600235 . = ALIGN(PAGE_SIZE); /* make sure the gate page doesn't expose
236 * kernel data
237 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700238
Christoph Lameterdc86e882005-12-12 09:34:32 -0800239 .data.read_mostly : AT(ADDR(.data.read_mostly) - LOAD_OFFSET)
240 { *(.data.read_mostly) }
241
Linus Torvalds1da177e2005-04-16 15:20:36 -0700242 .data.cacheline_aligned : AT(ADDR(.data.cacheline_aligned) - LOAD_OFFSET)
243 { *(.data.cacheline_aligned) }
244
245 /* Per-cpu data: */
246 percpu : { } :percpu
247 . = ALIGN(PERCPU_PAGE_SIZE);
248 __phys_per_cpu_start = .;
249 .data.percpu PERCPU_ADDR : AT(__phys_per_cpu_start - LOAD_OFFSET)
250 {
251 __per_cpu_start = .;
252 *(.data.percpu)
Fenghua Yu5fb7dc32007-07-19 01:48:12 -0700253 *(.data.percpu.shared_aligned)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700254 __per_cpu_end = .;
255 }
Al Stonedf8f0ec2006-08-12 11:08:12 -0600256 . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
257 * into percpu page size
258 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700259
260 data : { } :data
261 .data : AT(ADDR(.data) - LOAD_OFFSET)
Sam Ravnborgca967252007-05-17 13:38:44 +0200262 {
Tony Luckc459ce82008-09-29 16:39:19 -0700263#ifdef CONFIG_SMP
264 . = ALIGN(PERCPU_PAGE_SIZE);
265 __cpu0_per_cpu = .;
266 . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
267#endif
Sam Ravnborgca967252007-05-17 13:38:44 +0200268 DATA_DATA
269 *(.data1)
270 *(.gnu.linkonce.d*)
271 CONSTRUCTORS
272 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700273
274 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
275 .got : AT(ADDR(.got) - LOAD_OFFSET)
276 { *(.got.plt) *(.got) }
277 __gp = ADDR(.got) + 0x200000;
278 /* We want the small data sections together, so single-instruction offsets
279 can access them all, and initialized data all before uninitialized, so
280 we can shorten the on-disk segment size. */
281 .sdata : AT(ADDR(.sdata) - LOAD_OFFSET)
282 { *(.sdata) *(.sdata1) *(.srdata) }
283 _edata = .;
Bernhard Walleb898a422007-11-21 14:58:25 -0800284 __bss_start = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700285 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET)
286 { *(.sbss) *(.scommon) }
287 .bss : AT(ADDR(.bss) - LOAD_OFFSET)
288 { *(.bss) *(COMMON) }
Bernhard Walleb898a422007-11-21 14:58:25 -0800289 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700290
291 _end = .;
292
293 code : { } :code
294 /* Stabs debugging sections. */
295 .stab 0 : { *(.stab) }
296 .stabstr 0 : { *(.stabstr) }
297 .stab.excl 0 : { *(.stab.excl) }
298 .stab.exclstr 0 : { *(.stab.exclstr) }
299 .stab.index 0 : { *(.stab.index) }
300 .stab.indexstr 0 : { *(.stab.indexstr) }
301 /* DWARF debug sections.
302 Symbols in the DWARF debugging sections are relative to the beginning
303 of the section so we begin them at 0. */
304 /* DWARF 1 */
305 .debug 0 : { *(.debug) }
306 .line 0 : { *(.line) }
307 /* GNU DWARF 1 extensions */
308 .debug_srcinfo 0 : { *(.debug_srcinfo) }
309 .debug_sfnames 0 : { *(.debug_sfnames) }
310 /* DWARF 1.1 and DWARF 2 */
311 .debug_aranges 0 : { *(.debug_aranges) }
312 .debug_pubnames 0 : { *(.debug_pubnames) }
313 /* DWARF 2 */
314 .debug_info 0 : { *(.debug_info) }
315 .debug_abbrev 0 : { *(.debug_abbrev) }
316 .debug_line 0 : { *(.debug_line) }
317 .debug_frame 0 : { *(.debug_frame) }
318 .debug_str 0 : { *(.debug_str) }
319 .debug_loc 0 : { *(.debug_loc) }
320 .debug_macinfo 0 : { *(.debug_macinfo) }
321 /* SGI/MIPS DWARF 2 extensions */
322 .debug_weaknames 0 : { *(.debug_weaknames) }
323 .debug_funcnames 0 : { *(.debug_funcnames) }
324 .debug_typenames 0 : { *(.debug_typenames) }
325 .debug_varnames 0 : { *(.debug_varnames) }
326 /* These must appear regardless of . */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700327 /DISCARD/ : { *(.comment) }
328 /DISCARD/ : { *(.note) }
329}