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 |
Chris Metcalf | 6727ad9 | 2016-10-07 17:02:55 -0700 | [diff] [blame^] | 49 | CPUIDLE_TEXT |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 50 | LOCK_TEXT |
| 51 | KPROBES_TEXT |
| 52 | *(.gnu.linkonce.t*) |
| 53 | } |
| 54 | |
| 55 | .text2 : AT(ADDR(.text2) - LOAD_OFFSET) { |
| 56 | *(.text2) |
| 57 | } |
| 58 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 59 | #ifdef CONFIG_SMP |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 60 | .text..lock : AT(ADDR(.text..lock) - LOAD_OFFSET) { |
| 61 | *(.text..lock) |
| 62 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 63 | #endif |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 64 | _etext = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 65 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 66 | /* |
| 67 | * Read-only data |
| 68 | */ |
| 69 | NOTES :code :note /* put .notes in text and mark in PT_NOTE */ |
| 70 | code_continues : { |
| 71 | } : code /* switch back to regular program... */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 72 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 73 | EXCEPTION_TABLE(16) |
David Mosberger-Tang | 336cdba8 | 2007-08-09 11:53:15 -0600 | [diff] [blame] | 74 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 75 | /* MCA table */ |
| 76 | . = ALIGN(16); |
| 77 | __mca_table : AT(ADDR(__mca_table) - LOAD_OFFSET) { |
| 78 | __start___mca_table = .; |
| 79 | *(__mca_table) |
| 80 | __stop___mca_table = .; |
Russ Anderson | d89cfe7 | 2006-03-29 11:31:23 -0600 | [diff] [blame] | 81 | } |
| 82 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 83 | .data..patch.phys_stack_reg : AT(ADDR(.data..patch.phys_stack_reg) - LOAD_OFFSET) { |
| 84 | __start___phys_stack_reg_patchlist = .; |
| 85 | *(.data..patch.phys_stack_reg) |
| 86 | __end___phys_stack_reg_patchlist = .; |
Chen, Kenneth W | a0776ec | 2006-10-13 10:05:45 -0700 | [diff] [blame] | 87 | } |
| 88 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 89 | /* |
| 90 | * Global data |
| 91 | */ |
| 92 | _data = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 93 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 94 | /* Unwind info & table: */ |
| 95 | . = ALIGN(8); |
| 96 | .IA_64.unwind_info : AT(ADDR(.IA_64.unwind_info) - LOAD_OFFSET) { |
| 97 | *(.IA_64.unwind_info*) |
| 98 | } |
| 99 | .IA_64.unwind : AT(ADDR(.IA_64.unwind) - LOAD_OFFSET) { |
| 100 | __start_unwind = .; |
| 101 | *(.IA_64.unwind*) |
| 102 | __end_unwind = .; |
David Mosberger-Tang | 9bf77d0 | 2007-08-09 19:58:52 -0600 | [diff] [blame] | 103 | } :code :unwind |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 104 | code_continues2 : { |
| 105 | } : code |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 106 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 107 | RODATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 108 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 109 | .opd : AT(ADDR(.opd) - LOAD_OFFSET) { |
| 110 | *(.opd) |
Chen, Kenneth W | 39e18de | 2006-03-12 09:20:27 -0800 | [diff] [blame] | 111 | } |
| 112 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 113 | /* |
| 114 | * Initialization code and data: |
| 115 | */ |
| 116 | . = ALIGN(PAGE_SIZE); |
| 117 | __init_begin = .; |
| 118 | |
| 119 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 120 | INIT_DATA_SECTION(16) |
| 121 | |
| 122 | .data..patch.vtop : AT(ADDR(.data..patch.vtop) - LOAD_OFFSET) { |
| 123 | __start___vtop_patchlist = .; |
| 124 | *(.data..patch.vtop) |
| 125 | __end___vtop_patchlist = .; |
Tony Luck | 4dcc29e | 2008-05-27 13:23:16 -0700 | [diff] [blame] | 126 | } |
| 127 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 128 | .data..patch.rse : AT(ADDR(.data..patch.rse) - LOAD_OFFSET) { |
| 129 | __start___rse_patchlist = .; |
| 130 | *(.data..patch.rse) |
| 131 | __end___rse_patchlist = .; |
| 132 | } |
| 133 | |
| 134 | .data..patch.mckinley_e9 : AT(ADDR(.data..patch.mckinley_e9) - LOAD_OFFSET) { |
| 135 | __start___mckinley_e9_bundles = .; |
| 136 | *(.data..patch.mckinley_e9) |
| 137 | __end___mckinley_e9_bundles = .; |
Chen, Kenneth W | 39e18de | 2006-03-12 09:20:27 -0800 | [diff] [blame] | 138 | } |
| 139 | |
| 140 | #if defined(CONFIG_IA64_GENERIC) |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 141 | /* Machine Vector */ |
| 142 | . = ALIGN(16); |
| 143 | .machvec : AT(ADDR(.machvec) - LOAD_OFFSET) { |
| 144 | machvec_start = .; |
| 145 | *(.machvec) |
| 146 | machvec_end = .; |
Chen, Kenneth W | 39e18de | 2006-03-12 09:20:27 -0800 | [diff] [blame] | 147 | } |
| 148 | #endif |
| 149 | |
Tejun Heo | 3688647 | 2009-10-02 13:28:56 +0900 | [diff] [blame] | 150 | #ifdef CONFIG_SMP |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 151 | . = ALIGN(PERCPU_PAGE_SIZE); |
| 152 | __cpu0_per_cpu = .; |
| 153 | . = . + PERCPU_PAGE_SIZE; /* cpu0 per-cpu space */ |
Tejun Heo | 3688647 | 2009-10-02 13:28:56 +0900 | [diff] [blame] | 154 | #endif |
| 155 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 156 | . = ALIGN(PAGE_SIZE); |
| 157 | __init_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 158 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 159 | .data..page_aligned : AT(ADDR(.data..page_aligned) - LOAD_OFFSET) { |
| 160 | PAGE_ALIGNED_DATA(PAGE_SIZE) |
| 161 | . = ALIGN(PAGE_SIZE); |
| 162 | __start_gate_section = .; |
| 163 | *(.data..gate) |
| 164 | __stop_gate_section = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 165 | } |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 166 | /* |
| 167 | * make sure the gate page doesn't expose |
| 168 | * kernel data |
| 169 | */ |
| 170 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 171 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 172 | /* Per-cpu data: */ |
| 173 | . = ALIGN(PERCPU_PAGE_SIZE); |
Tejun Heo | 19df0c2 | 2011-01-25 14:26:50 +0100 | [diff] [blame] | 174 | PERCPU_VADDR(SMP_CACHE_BYTES, PERCPU_ADDR, :percpu) |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 175 | __phys_per_cpu_start = __per_cpu_load; |
| 176 | /* |
| 177 | * ensure percpu data fits |
| 178 | * into percpu page size |
| 179 | */ |
| 180 | . = __phys_per_cpu_start + PERCPU_PAGE_SIZE; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 181 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 182 | data : { |
| 183 | } :data |
| 184 | .data : AT(ADDR(.data) - LOAD_OFFSET) { |
Tony Luck | 30f7276 | 2011-05-20 10:38:53 -0700 | [diff] [blame] | 185 | _sdata = .; |
Nelson Elhage | 6ae8635 | 2009-07-31 16:57:53 -0400 | [diff] [blame] | 186 | INIT_TASK_DATA(PAGE_SIZE) |
| 187 | CACHELINE_ALIGNED_DATA(SMP_CACHE_BYTES) |
| 188 | READ_MOSTLY_DATA(SMP_CACHE_BYTES) |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 189 | DATA_DATA |
| 190 | *(.data1) |
| 191 | *(.gnu.linkonce.d*) |
| 192 | CONSTRUCTORS |
| 193 | } |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 195 | . = ALIGN(16); /* gp must be 16-byte aligned for exc. table */ |
| 196 | .got : AT(ADDR(.got) - LOAD_OFFSET) { |
| 197 | *(.got.plt) |
| 198 | *(.got) |
| 199 | } |
| 200 | __gp = ADDR(.got) + 0x200000; |
Nelson Elhage | 6ae8635 | 2009-07-31 16:57:53 -0400 | [diff] [blame] | 201 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 202 | /* |
| 203 | * We want the small data sections together, |
| 204 | * so single-instruction offsets can access |
| 205 | * them all, and initialized data all before |
| 206 | * uninitialized, so we can shorten the |
| 207 | * on-disk segment size. |
| 208 | */ |
| 209 | .sdata : AT(ADDR(.sdata) - LOAD_OFFSET) { |
| 210 | *(.sdata) |
| 211 | *(.sdata1) |
| 212 | *(.srdata) |
| 213 | } |
| 214 | _edata = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 215 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 216 | BSS_SECTION(0, 0, 0) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 217 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 218 | _end = .; |
Nelson Elhage | 6ae8635 | 2009-07-31 16:57:53 -0400 | [diff] [blame] | 219 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 220 | code : { |
| 221 | } :code |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 222 | |
Sam Ravnborg | 7b313fd | 2010-06-19 17:19:25 +0200 | [diff] [blame] | 223 | STABS_DEBUG |
| 224 | DWARF_DEBUG |
| 225 | |
| 226 | /* Default discards */ |
| 227 | DISCARDS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 228 | } |