blob: b484b86da8308bf5bbc656c3930f0f045754ddf4 [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 }
54 .text2 : AT(ADDR(.text2) - LOAD_OFFSET)
55 { *(.text2) }
56#ifdef CONFIG_SMP
57 .text.lock : AT(ADDR(.text.lock) - LOAD_OFFSET)
58 { *(.text.lock) }
59#endif
60 _etext = .;
61
62 /* Read-only data */
63
David Mosberger-Tang336cdba82007-08-09 11:53:15 -060064 NOTES :code :note /* put .notes in text and mark in PT_NOTE */
65 code_continues : {} :code /* switch back to regular program... */
66
Linus Torvalds1da177e2005-04-16 15:20:36 -070067 /* Exception table */
68 . = ALIGN(16);
69 __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET)
70 {
71 __start___ex_table = .;
72 *(__ex_table)
73 __stop___ex_table = .;
74 }
75
Russ Andersond89cfe72006-03-29 11:31:23 -060076 /* MCA table */
77 . = ALIGN(16);
78 __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET)
79 {
80 __start___mca_table = .;
81 *(__mca_table)
82 __stop___mca_table = .;
83 }
84
Chen, Kenneth Wa0776ec2006-10-13 10:05:45 -070085 .data.patch.phys_stack_reg : AT(ADDR(.data.patch.phys_stack_reg) - LOAD_OFFSET)
86 {
87 __start___phys_stack_reg_patchlist = .;
88 *(.data.patch.phys_stack_reg)
89 __end___phys_stack_reg_patchlist = .;
90 }
91
Linus Torvalds1da177e2005-04-16 15:20:36 -070092 /* Global data */
93 _data = .;
94
Linus Torvalds1da177e2005-04-16 15:20:36 -070095 /* Unwind info & table: */
96 . = ALIGN(8);
97 .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET)
98 { *(.IA_64.unwind_info*) }
99 .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET)
100 {
101 __start_unwind = .;
102 *(.IA_64.unwind*)
103 __end_unwind = .;
David Mosberger-Tang9bf77d02007-08-09 19:58:52 -0600104 } :code :unwind
105 code_continues2 : {} : code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700106
107 RODATA
108
109 .opd : AT(ADDR(.opd) - LOAD_OFFSET)
110 { *(.opd) }
111
112 /* Initialization code and data: */
113
114 . = ALIGN(PAGE_SIZE);
115 __init_begin = .;
116 .init.text : AT(ADDR(.init.text) - LOAD_OFFSET)
117 {
118 _sinittext = .;
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100119 INIT_TEXT
Linus Torvalds1da177e2005-04-16 15:20:36 -0700120 _einittext = .;
121 }
122
123 .init.data : AT(ADDR(.init.data) - LOAD_OFFSET)
Sam Ravnborg01ba2bd2008-01-20 14:15:03 +0100124 { INIT_DATA }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700125
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800126#ifdef CONFIG_BLK_DEV_INITRD
Linus Torvalds1da177e2005-04-16 15:20:36 -0700127 .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET)
128 {
129 __initramfs_start = .;
130 *(.init.ramfs)
131 __initramfs_end = .;
132 }
Jean-Paul Saman67d38222007-02-10 01:44:44 -0800133#endif
Linus Torvalds1da177e2005-04-16 15:20:36 -0700134
135 . = ALIGN(16);
136 .init.setup : AT(ADDR(.init.setup) - LOAD_OFFSET)
137 {
138 __setup_start = .;
139 *(.init.setup)
140 __setup_end = .;
141 }
142 .initcall.init : AT(ADDR(.initcall.init) - LOAD_OFFSET)
143 {
144 __initcall_start = .;
Andrew Morton61ce1ef2006-10-27 11:41:44 -0700145 INITCALLS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700146 __initcall_end = .;
147 }
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800148
149 .data.patch.vtop : AT(ADDR(.data.patch.vtop) - LOAD_OFFSET)
150 {
151 __start___vtop_patchlist = .;
152 *(.data.patch.vtop)
153 __end___vtop_patchlist = .;
154 }
155
Tony Luck4dcc29e2008-05-27 13:23:16 -0700156 .data.patch.rse : AT(ADDR(.data.patch.rse) - LOAD_OFFSET)
157 {
158 __start___rse_patchlist = .;
159 *(.data.patch.rse)
160 __end___rse_patchlist = .;
161 }
162
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800163 .data.patch.mckinley_e9 : AT(ADDR(.data.patch.mckinley_e9) - LOAD_OFFSET)
164 {
165 __start___mckinley_e9_bundles = .;
166 *(.data.patch.mckinley_e9)
167 __end___mckinley_e9_bundles = .;
168 }
169
Isaku Yamahatabf7ab022009-03-04 21:06:51 +0900170#if defined(CONFIG_PARAVIRT)
171 . = ALIGN(16);
172 .paravirt_bundles : AT(ADDR(.paravirt_bundles) - LOAD_OFFSET)
173 {
174 __start_paravirt_bundles = .;
175 *(.paravirt_bundles)
176 __stop_paravirt_bundles = .;
177 }
178 . = ALIGN(16);
179 .paravirt_insts : AT(ADDR(.paravirt_insts) - LOAD_OFFSET)
180 {
181 __start_paravirt_insts = .;
182 *(.paravirt_insts)
183 __stop_paravirt_insts = .;
184 }
185 . = ALIGN(16);
186 .paravirt_branches : AT(ADDR(.paravirt_branches) - LOAD_OFFSET)
187 {
188 __start_paravirt_branches = .;
189 *(.paravirt_branches)
190 __stop_paravirt_branches = .;
191 }
192#endif
193
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800194#if defined(CONFIG_IA64_GENERIC)
195 /* Machine Vector */
196 . = ALIGN(16);
197 .machvec : AT(ADDR(.machvec) - LOAD_OFFSET)
198 {
199 machvec_start = .;
200 *(.machvec)
201 machvec_end = .;
202 }
203#endif
204
Kirill Korotaevd00195e2007-02-05 16:19:59 -0800205 . = ALIGN(8);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700206 __con_initcall_start = .;
207 .con_initcall.init : AT(ADDR(.con_initcall.init) - LOAD_OFFSET)
208 { *(.con_initcall.init) }
209 __con_initcall_end = .;
210 __security_initcall_start = .;
211 .security_initcall.init : AT(ADDR(.security_initcall.init) - LOAD_OFFSET)
212 { *(.security_initcall.init) }
213 __security_initcall_end = .;
214 . = ALIGN(PAGE_SIZE);
215 __init_end = .;
216
217 /* The initial task and kernel stack */
218 .data.init_task : AT(ADDR(.data.init_task) - LOAD_OFFSET)
219 { *(.data.init_task) }
220
221 .data.page_aligned : AT(ADDR(.data.page_aligned) - LOAD_OFFSET)
Nelson Elhageed7af3e2009-07-31 16:57:52 -0400222 {
223 PAGE_ALIGNED_DATA(PAGE_SIZE)
224 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700225 __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: */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700246 . = ALIGN(PERCPU_PAGE_SIZE);
Tejun Heo19390c42009-03-10 16:27:48 +0900247 PERCPU_VADDR(PERCPU_ADDR, :percpu)
248 __phys_per_cpu_start = __per_cpu_load;
Al Stonedf8f0ec2006-08-12 11:08:12 -0600249 . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; /* ensure percpu data fits
250 * into percpu page size
251 */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700252
253 data : { } :data
254 .data : AT(ADDR(.data) - LOAD_OFFSET)
Sam Ravnborgca967252007-05-17 13:38:44 +0200255 {
Tony Luckc459ce82008-09-29 16:39:19 -0700256#ifdef CONFIG_SMP
257 . = ALIGN(PERCPU_PAGE_SIZE);
258 __cpu0_per_cpu = .;
259 . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
260#endif
Sam Ravnborgca967252007-05-17 13:38:44 +0200261 DATA_DATA
262 *(.data1)
263 *(.gnu.linkonce.d*)
264 CONSTRUCTORS
265 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700266
267 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
268 .got : AT(ADDR(.got) - LOAD_OFFSET)
269 { *(.got.plt) *(.got) }
270 __gp = ADDR(.got) + 0x200000;
271 /* We want the small data sections together, so single-instruction offsets
272 can access them all, and initialized data all before uninitialized, so
273 we can shorten the on-disk segment size. */
274 .sdata : AT(ADDR(.sdata) - LOAD_OFFSET)
275 { *(.sdata) *(.sdata1) *(.srdata) }
276 _edata = .;
Bernhard Walleb898a422007-11-21 14:58:25 -0800277 __bss_start = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700278 .sbss : AT(ADDR(.sbss) - LOAD_OFFSET)
279 { *(.sbss) *(.scommon) }
280 .bss : AT(ADDR(.bss) - LOAD_OFFSET)
281 { *(.bss) *(COMMON) }
Bernhard Walleb898a422007-11-21 14:58:25 -0800282 __bss_stop = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700283
284 _end = .;
285
286 code : { } :code
287 /* Stabs debugging sections. */
288 .stab 0 : { *(.stab) }
289 .stabstr 0 : { *(.stabstr) }
290 .stab.excl 0 : { *(.stab.excl) }
291 .stab.exclstr 0 : { *(.stab.exclstr) }
292 .stab.index 0 : { *(.stab.index) }
293 .stab.indexstr 0 : { *(.stab.indexstr) }
294 /* DWARF debug sections.
295 Symbols in the DWARF debugging sections are relative to the beginning
296 of the section so we begin them at 0. */
297 /* DWARF 1 */
298 .debug 0 : { *(.debug) }
299 .line 0 : { *(.line) }
300 /* GNU DWARF 1 extensions */
301 .debug_srcinfo 0 : { *(.debug_srcinfo) }
302 .debug_sfnames 0 : { *(.debug_sfnames) }
303 /* DWARF 1.1 and DWARF 2 */
304 .debug_aranges 0 : { *(.debug_aranges) }
305 .debug_pubnames 0 : { *(.debug_pubnames) }
306 /* DWARF 2 */
307 .debug_info 0 : { *(.debug_info) }
308 .debug_abbrev 0 : { *(.debug_abbrev) }
309 .debug_line 0 : { *(.debug_line) }
310 .debug_frame 0 : { *(.debug_frame) }
311 .debug_str 0 : { *(.debug_str) }
312 .debug_loc 0 : { *(.debug_loc) }
313 .debug_macinfo 0 : { *(.debug_macinfo) }
314 /* SGI/MIPS DWARF 2 extensions */
315 .debug_weaknames 0 : { *(.debug_weaknames) }
316 .debug_funcnames 0 : { *(.debug_funcnames) }
317 .debug_typenames 0 : { *(.debug_typenames) }
318 .debug_varnames 0 : { *(.debug_varnames) }
319 /* These must appear regardless of . */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700320 /DISCARD/ : { *(.comment) }
321 /DISCARD/ : { *(.note) }
322}