Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | |
| 2 | #include <asm/cache.h> |
| 3 | #include <asm/ptrace.h> |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 4 | #include <asm/pgtable.h> |
| 5 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 6 | #include <asm-generic/vmlinux.lds.h> |
| 7 | |
| 8 | OUTPUT_FORMAT("elf64-ia64-little") |
| 9 | OUTPUT_ARCH(ia64) |
| 10 | ENTRY(phys_start) |
| 11 | jiffies = jiffies_64; |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 12 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 13 | PHDRS { |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 14 | 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 19 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 20 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 21 | SECTIONS { |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 32 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 33 | v = PAGE_OFFSET; /* this symbol is here to make debugging easier... */ |
| 34 | phys_start = _start - LOAD_OFFSET; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 35 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 36 | code : { |
| 37 | } :code |
| 38 | . = KERNEL_START; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 39 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 40 | _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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 58 | #ifdef CONFIG_SMP |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 59 | .text..lock : AT(ADDR(.text..lock) - LOAD_OFFSET) { |
| 60 | *(.text..lock) |
| 61 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 62 | #endif |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 63 | _etext = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 64 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 65 | /* |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 71 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 72 | EXCEPTION_TABLE(16) |
David Mosberger-Tang | 336cdba8 | 2007-08-09 11:53:15 -0600 | [diff] [blame] | 73 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 74 | /* 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 Anderson | d89cfe7 | 2006-03-29 11:31:23 -0600 | [diff] [blame] | 80 | } |
| 81 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 82 | .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 W | a0776ec | 2006-10-13 10:05:45 -0700 | [diff] [blame] | 86 | } |
| 87 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 88 | /* |
| 89 | * Global data |
| 90 | */ |
| 91 | _data = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 92 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 93 | /* 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-Tang | 9bf77d0 | 2007-08-09 19:58:52 -0600 | [diff] [blame] | 102 | } :code :unwind |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 103 | code_continues2 : { |
| 104 | } : code |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 105 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 106 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 107 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 108 | .opd : AT(ADDR(.opd) - LOAD_OFFSET) { |
| 109 | *(.opd) |
Chen, Kenneth W | 39e18de | 2006-03-12 09:20:27 -0800 | [diff] [blame] | 110 | } |
| 111 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 112 | /* |
| 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 Luck | 4dcc29e | 2008-05-27 13:23:16 -0700 | [diff] [blame] | 125 | } |
| 126 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 127 | .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 W | 39e18de | 2006-03-12 09:20:27 -0800 | [diff] [blame] | 137 | } |
| 138 | |
Isaku Yamahata | bf7ab02 | 2009-03-04 21:06:51 +0900 | [diff] [blame] | 139 | #if defined(CONFIG_PARAVIRT) |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 140 | . = ALIGN(16); |
| 141 | .paravirt_bundles : AT(ADDR(.paravirt_bundles) - LOAD_OFFSET) { |
| 142 | __start_paravirt_bundles = .; |
| 143 | *(.paravirt_bundles) |
| 144 | __stop_paravirt_bundles = .; |
Isaku Yamahata | bf7ab02 | 2009-03-04 21:06:51 +0900 | [diff] [blame] | 145 | } |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 146 | . = ALIGN(16); |
| 147 | .paravirt_insts : AT(ADDR(.paravirt_insts) - LOAD_OFFSET) { |
| 148 | __start_paravirt_insts = .; |
| 149 | *(.paravirt_insts) |
| 150 | __stop_paravirt_insts = .; |
Isaku Yamahata | bf7ab02 | 2009-03-04 21:06:51 +0900 | [diff] [blame] | 151 | } |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 152 | . = ALIGN(16); |
| 153 | .paravirt_branches : AT(ADDR(.paravirt_branches) - LOAD_OFFSET) { |
| 154 | __start_paravirt_branches = .; |
| 155 | *(.paravirt_branches) |
| 156 | __stop_paravirt_branches = .; |
Isaku Yamahata | bf7ab02 | 2009-03-04 21:06:51 +0900 | [diff] [blame] | 157 | } |
| 158 | #endif |
| 159 | |
Chen, Kenneth W | 39e18de | 2006-03-12 09:20:27 -0800 | [diff] [blame] | 160 | #if defined(CONFIG_IA64_GENERIC) |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 161 | /* Machine Vector */ |
| 162 | . = ALIGN(16); |
| 163 | .machvec : AT(ADDR(.machvec) - LOAD_OFFSET) { |
| 164 | machvec_start = .; |
| 165 | *(.machvec) |
| 166 | machvec_end = .; |
Chen, Kenneth W | 39e18de | 2006-03-12 09:20:27 -0800 | [diff] [blame] | 167 | } |
| 168 | #endif |
| 169 | |
Tejun Heo | 3688647 | 2009-10-02 13:28:56 +0900 | [diff] [blame] | 170 | #ifdef CONFIG_SMP |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 171 | . = ALIGN(PERCPU_PAGE_SIZE); |
| 172 | __cpu0_per_cpu = .; |
| 173 | . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */ |
Tejun Heo | 3688647 | 2009-10-02 13:28:56 +0900 | [diff] [blame] | 174 | #endif |
| 175 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 176 | . = ALIGN(PAGE_SIZE); |
| 177 | __init_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 178 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 179 | .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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 185 | } |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 186 | /* |
| 187 | * make sure the gate page doesn't expose |
| 188 | * kernel data |
| 189 | */ |
| 190 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 192 | /* Per-cpu data: */ |
| 193 | . = ALIGN(PERCPU_PAGE_SIZE); |
Tejun Heo | 19df0c2 | 2011-01-25 14:26:50 +0100 | [diff] [blame] | 194 | PERCPU_VADDR(SMP_CACHE_BYTES, PERCPU_ADDR, :percpu) |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 195 | __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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 201 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 202 | data : { |
| 203 | } :data |
| 204 | .data : AT(ADDR(.data) - LOAD_OFFSET) { |
Tony Luck | 30f7276 | 2011-05-20 10:38:53 -0700 | [diff] [blame] | 205 | _sdata = .; |
Nelson Elhage | 6ae8635 | 2009-07-31 16:57:53 -0400 | [diff] [blame] | 206 | INIT_TASK_DATA(PAGE_SIZE) |
| 207 | CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES) |
| 208 | READ_MOSTLY_DATA(SMP_CACHE_BYTES) |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 209 | DATA_DATA |
| 210 | *(.data1) |
| 211 | *(.gnu.linkonce.d*) |
| 212 | CONSTRUCTORS |
| 213 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 214 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 215 | . = 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 Elhage | 6ae8635 | 2009-07-31 16:57:53 -0400 | [diff] [blame] | 221 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 222 | /* |
| 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 Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 235 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 236 | BSS_SECTION(0, 0, 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 237 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 238 | _end = .; |
Nelson Elhage | 6ae8635 | 2009-07-31 16:57:53 -0400 | [diff] [blame] | 239 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 240 | code : { |
| 241 | } :code |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 242 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 243 | STABS_DEBUG |
| 244 | DWARF_DEBUG |
| 245 | |
| 246 | /* Default discards */ |
| 247 | DISCARDS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 248 | } |