blob: 84f8a52ac5ae2bdb65004691813aed4ed008ea9f [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001
2#include <asm/cache.h>
3#include <asm/ptrace.h>
Linus Torvalds1da177e2005-04-16 15:20:36 -07004#include <asm/pgtable.h>
5
Linus Torvalds1da177e2005-04-16 15:20:36 -07006#include <asm-generic/vmlinux.lds.h>
7
8OUTPUT_FORMAT("elf64-ia64-little")
9OUTPUT_ARCH(ia64)
10ENTRY(phys_start)
11jiffies = jiffies_64;
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020012
Linus Torvalds1da177e2005-04-16 15:20:36 -070013PHDRS {
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020014 code PT_LOAD;
15 percpu PT_LOAD;
16 data PT_LOAD;
17 note PT_NOTE;
18 unwind 0x70000001; /* PT_IA_64_UNWIND, but ld doesn't match the name */
Linus Torvalds1da177e2005-04-16 15:20:36 -070019}
Linus Torvalds1da177e2005-04-16 15:20:36 -070020
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020021SECTIONS {
22 /*
23 * unwind exit sections must be discarded before
24 * the rest of the sections get included.
25 */
26 /DISCARD/ : {
27 *(.IA_64.unwind.exit.text)
28 *(.IA_64.unwind_info.exit.text)
29 *(.comment)
30 *(.note)
31 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070032
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020033 v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */
34 phys_start = _start - LOAD_OFFSET;
Linus Torvalds1da177e2005-04-16 15:20:36 -070035
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020036 code : {
37 } :code
38 . = KERNEL_START;
Linus Torvalds1da177e2005-04-16 15:20:36 -070039
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020040 _text = .;
41 _stext = .;
42
43 .text : AT(ADDR(.text) - LOAD_OFFSET) {
44 __start_ivt_text = .;
45 *(.text..ivt)
46 __end_ivt_text = .;
47 TEXT_TEXT
48 SCHED_TEXT
49 LOCK_TEXT
50 KPROBES_TEXT
51 *(.gnu.linkonce.t*)
52 }
53
54 .text2 : AT(ADDR(.text2) - LOAD_OFFSET) {
55 *(.text2)
56 }
57
Linus Torvalds1da177e2005-04-16 15:20:36 -070058#ifdef CONFIG_SMP
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020059 .text..lock : AT(ADDR(.text..lock) - LOAD_OFFSET) {
60 *(.text..lock)
61 }
Linus Torvalds1da177e2005-04-16 15:20:36 -070062#endif
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020063 _etext = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070064
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020065 /*
66 * Read-only data
67 */
68 NOTES :code :note /* put .notes in text and mark in PT_NOTE */
69 code_continues : {
70 } : code /* switch back to regular program... */
Linus Torvalds1da177e2005-04-16 15:20:36 -070071
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020072 EXCEPTION_TABLE(16)
David Mosberger-Tang336cdba82007-08-09 11:53:15 -060073
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020074 /* MCA table */
75 . = ALIGN(16);
76 __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET) {
77 __start___mca_table = .;
78 *(__mca_table)
79 __stop___mca_table = .;
Russ Andersond89cfe72006-03-29 11:31:23 -060080 }
81
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020082 .data..patch.phys_stack_reg : AT(ADDR(.data..patch.phys_stack_reg) - LOAD_OFFSET) {
83 __start___phys_stack_reg_patchlist = .;
84 *(.data..patch.phys_stack_reg)
85 __end___phys_stack_reg_patchlist = .;
Chen, Kenneth Wa0776ec2006-10-13 10:05:45 -070086 }
87
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020088 /*
89 * Global data
90 */
91 _data = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -070092
Sam Ravnborg7b313fd2010-06-19 17:19:25 +020093 /* Unwind info & table: */
94 . = ALIGN(8);
95 .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET) {
96 *(.IA_64.unwind_info*)
97 }
98 .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET) {
99 __start_unwind = .;
100 *(.IA_64.unwind*)
101 __end_unwind = .;
David Mosberger-Tang9bf77d02007-08-09 19:58:52 -0600102 } :code :unwind
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200103 code_continues2 : {
104 } : code
Linus Torvalds1da177e2005-04-16 15:20:36 -0700105
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200106 RODATA
Linus Torvalds1da177e2005-04-16 15:20:36 -0700107
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200108 .opd : AT(ADDR(.opd) - LOAD_OFFSET) {
109 *(.opd)
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800110 }
111
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200112 /*
113 * Initialization code and data:
114 */
115 . = ALIGN(PAGE_SIZE);
116 __init_begin = .;
117
118 INIT_TEXT_SECTION(PAGE_SIZE)
119 INIT_DATA_SECTION(16)
120
121 .data..patch.vtop : AT(ADDR(.data..patch.vtop) - LOAD_OFFSET) {
122 __start___vtop_patchlist = .;
123 *(.data..patch.vtop)
124 __end___vtop_patchlist = .;
Tony Luck4dcc29e2008-05-27 13:23:16 -0700125 }
126
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200127 .data..patch.rse : AT(ADDR(.data..patch.rse) - LOAD_OFFSET) {
128 __start___rse_patchlist = .;
129 *(.data..patch.rse)
130 __end___rse_patchlist = .;
131 }
132
133 .data..patch.mckinley_e9 : AT(ADDR(.data..patch.mckinley_e9) - LOAD_OFFSET) {
134 __start___mckinley_e9_bundles = .;
135 *(.data..patch.mckinley_e9)
136 __end___mckinley_e9_bundles = .;
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800137 }
138
Isaku Yamahatabf7ab022009-03-04 21:06:51 +0900139#if defined(CONFIG_PARAVIRT)
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200140 . = ALIGN(16);
141 .paravirt_bundles : AT(ADDR(.paravirt_bundles) - LOAD_OFFSET) {
142 __start_paravirt_bundles = .;
143 *(.paravirt_bundles)
144 __stop_paravirt_bundles = .;
Isaku Yamahatabf7ab022009-03-04 21:06:51 +0900145 }
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200146 . = ALIGN(16);
147 .paravirt_insts : AT(ADDR(.paravirt_insts) - LOAD_OFFSET) {
148 __start_paravirt_insts = .;
149 *(.paravirt_insts)
150 __stop_paravirt_insts = .;
Isaku Yamahatabf7ab022009-03-04 21:06:51 +0900151 }
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200152 . = ALIGN(16);
153 .paravirt_branches : AT(ADDR(.paravirt_branches) - LOAD_OFFSET) {
154 __start_paravirt_branches = .;
155 *(.paravirt_branches)
156 __stop_paravirt_branches = .;
Isaku Yamahatabf7ab022009-03-04 21:06:51 +0900157 }
158#endif
159
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800160#if defined(CONFIG_IA64_GENERIC)
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200161 /* Machine Vector */
162 . = ALIGN(16);
163 .machvec : AT(ADDR(.machvec) - LOAD_OFFSET) {
164 machvec_start = .;
165 *(.machvec)
166 machvec_end = .;
Chen, Kenneth W39e18de2006-03-12 09:20:27 -0800167 }
168#endif
169
Tejun Heo36886472009-10-02 13:28:56 +0900170#ifdef CONFIG_SMP
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200171 . = ALIGN(PERCPU_PAGE_SIZE);
172 __cpu0_per_cpu = .;
173 . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */
Tejun Heo36886472009-10-02 13:28:56 +0900174#endif
175
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200176 . = ALIGN(PAGE_SIZE);
177 __init_end = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700178
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200179 .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) {
180 PAGE_ALIGNED_DATA(PAGE_SIZE)
181 . = ALIGN(PAGE_SIZE);
182 __start_gate_section = .;
183 *(.data..gate)
184 __stop_gate_section = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185 }
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200186 /*
187 * make sure the gate page doesn't expose
188 * kernel data
189 */
190 . = ALIGN(PAGE_SIZE);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700191
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200192 /* Per-cpu data: */
193 . = ALIGN(PERCPU_PAGE_SIZE);
Tejun Heo19df0c22011-01-25 14:26:50 +0100194 PERCPU_VADDR(SMP_CACHE_BYTES, PERCPU_ADDR, :percpu)
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200195 __phys_per_cpu_start = __per_cpu_load;
196 /*
197 * ensure percpu data fits
198 * into percpu page size
199 */
200 . = __phys_per_cpu_start + PERCPU_PAGE_SIZE;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700201
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200202 data : {
203 } :data
204 .data : AT(ADDR(.data) - LOAD_OFFSET) {
Tony Luck30f72762011-05-20 10:38:53 -0700205 _sdata = .;
Nelson Elhage6ae86352009-07-31 16:57:53 -0400206 INIT_TASK_DATA(PAGE_SIZE)
207 CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES)
208 READ_MOSTLY_DATA(SMP_CACHE_BYTES)
Sam Ravnborgca967252007-05-17 13:38:44 +0200209 DATA_DATA
210 *(.data1)
211 *(.gnu.linkonce.d*)
212 CONSTRUCTORS
213 }
Linus Torvalds1da177e2005-04-16 15:20:36 -0700214
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200215 . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */
216 .got : AT(ADDR(.got) - LOAD_OFFSET) {
217 *(.got.plt)
218 *(.got)
219 }
220 __gp = ADDR(.got) + 0x200000;
Nelson Elhage6ae86352009-07-31 16:57:53 -0400221
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200222 /*
223 * We want the small data sections together,
224 * so single-instruction offsets can access
225 * them all, and initialized data all before
226 * uninitialized, so we can shorten the
227 * on-disk segment size.
228 */
229 .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) {
230 *(.sdata)
231 *(.sdata1)
232 *(.srdata)
233 }
234 _edata = .;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700235
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200236 BSS_SECTION(0, 0, 0)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700237
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200238 _end = .;
Nelson Elhage6ae86352009-07-31 16:57:53 -0400239
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200240 code : {
241 } :code
Tejun Heo023bf6f2009-07-09 11:27:40 +0900242
Sam Ravnborg7b313fd2010-06-19 17:19:25 +0200243 STABS_DEBUG
244 DWARF_DEBUG
245
246 /* Default discards */
247 DISCARDS
Linus Torvalds1da177e2005-04-16 15:20:36 -0700248}