Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 1 | /* ld script to make ARM Linux kernel |
| 2 | * taken from the i386 version by Russell King |
| 3 | * Written by Martin Mares <mj@atrey.karlin.mff.cuni.cz> |
| 4 | */ |
| 5 | |
| 6 | #include <asm-generic/vmlinux.lds.h> |
Will Deacon | f0d5375 | 2012-01-20 11:55:54 +0100 | [diff] [blame] | 7 | #include <asm/cache.h> |
Russell King | 4f7a181 | 2005-05-05 13:11:00 +0100 | [diff] [blame] | 8 | #include <asm/thread_info.h> |
Nicolas Pitre | 37d07b7 | 2005-10-29 21:44:56 +0100 | [diff] [blame] | 9 | #include <asm/memory.h> |
Linus Walleij | f6430a9 | 2009-06-24 23:38:56 +0100 | [diff] [blame] | 10 | #include <asm/page.h> |
Kees Cook | 1e6b481 | 2014-04-03 17:28:11 -0700 | [diff] [blame] | 11 | #ifdef CONFIG_ARM_KERNMEM_PERMS |
| 12 | #include <asm/pgtable.h> |
| 13 | #endif |
Ard Biesheuvel | e60a1fe | 2015-03-23 10:52:57 +0000 | [diff] [blame] | 14 | |
Russell King | 5085f3f | 2010-10-01 15:37:05 +0100 | [diff] [blame] | 15 | #define PROC_INFO \ |
Marc Zyngier | b8b9987 | 2012-02-07 02:46:38 +0100 | [diff] [blame] | 16 | . = ALIGN(4); \ |
Russell King | 5085f3f | 2010-10-01 15:37:05 +0100 | [diff] [blame] | 17 | VMLINUX_SYMBOL(__proc_info_begin) = .; \ |
| 18 | *(.proc.info.init) \ |
| 19 | VMLINUX_SYMBOL(__proc_info_end) = .; |
| 20 | |
Will Deacon | 8903826 | 2011-09-30 11:43:29 +0100 | [diff] [blame] | 21 | #define IDMAP_TEXT \ |
| 22 | ALIGN_FUNCTION(); \ |
| 23 | VMLINUX_SYMBOL(__idmap_text_start) = .; \ |
| 24 | *(.idmap.text) \ |
Christoffer Dall | 9e9a367 | 2013-01-20 18:43:10 -0500 | [diff] [blame] | 25 | VMLINUX_SYMBOL(__idmap_text_end) = .; \ |
Ard Biesheuvel | a9fea8b | 2015-03-27 10:18:01 +0000 | [diff] [blame] | 26 | . = ALIGN(PAGE_SIZE); \ |
Christoffer Dall | 9e9a367 | 2013-01-20 18:43:10 -0500 | [diff] [blame] | 27 | VMLINUX_SYMBOL(__hyp_idmap_text_start) = .; \ |
| 28 | *(.hyp.idmap.text) \ |
| 29 | VMLINUX_SYMBOL(__hyp_idmap_text_end) = .; |
Will Deacon | 8903826 | 2011-09-30 11:43:29 +0100 | [diff] [blame] | 30 | |
Russell King | 5085f3f | 2010-10-01 15:37:05 +0100 | [diff] [blame] | 31 | #ifdef CONFIG_HOTPLUG_CPU |
| 32 | #define ARM_CPU_DISCARD(x) |
| 33 | #define ARM_CPU_KEEP(x) x |
| 34 | #else |
| 35 | #define ARM_CPU_DISCARD(x) x |
| 36 | #define ARM_CPU_KEEP(x) |
| 37 | #endif |
| 38 | |
Simon Glass | 87e040b | 2011-08-16 23:44:26 +0100 | [diff] [blame] | 39 | #if (defined(CONFIG_SMP_ON_UP) && !defined(CONFIG_DEBUG_SPINLOCK)) || \ |
| 40 | defined(CONFIG_GENERIC_BUG) |
Russell King | a9ad21f | 2011-02-21 10:13:36 +0000 | [diff] [blame] | 41 | #define ARM_EXIT_KEEP(x) x |
Russell King | 6760b10 | 2011-09-20 23:35:15 +0100 | [diff] [blame] | 42 | #define ARM_EXIT_DISCARD(x) |
Russell King | a9ad21f | 2011-02-21 10:13:36 +0000 | [diff] [blame] | 43 | #else |
| 44 | #define ARM_EXIT_KEEP(x) |
Russell King | 6760b10 | 2011-09-20 23:35:15 +0100 | [diff] [blame] | 45 | #define ARM_EXIT_DISCARD(x) x |
Russell King | a9ad21f | 2011-02-21 10:13:36 +0000 | [diff] [blame] | 46 | #endif |
| 47 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 48 | OUTPUT_ARCH(arm) |
| 49 | ENTRY(stext) |
Nicolas Pitre | 37d07b7 | 2005-10-29 21:44:56 +0100 | [diff] [blame] | 50 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 51 | #ifndef __ARMEB__ |
| 52 | jiffies = jiffies_64; |
| 53 | #else |
| 54 | jiffies = jiffies_64 + 4; |
| 55 | #endif |
Nicolas Pitre | 37d07b7 | 2005-10-29 21:44:56 +0100 | [diff] [blame] | 56 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 57 | SECTIONS |
| 58 | { |
Russell King | 39df888 | 2011-05-26 11:25:33 +0100 | [diff] [blame] | 59 | /* |
Russell King | 6760b10 | 2011-09-20 23:35:15 +0100 | [diff] [blame] | 60 | * XXX: The linker does not define how output sections are |
| 61 | * assigned to input sections when there are multiple statements |
| 62 | * matching the same input section name. There is no documented |
| 63 | * order of matching. |
| 64 | * |
Russell King | 39df888 | 2011-05-26 11:25:33 +0100 | [diff] [blame] | 65 | * unwind exit sections must be discarded before the rest of the |
| 66 | * unwind sections get included. |
| 67 | */ |
| 68 | /DISCARD/ : { |
| 69 | *(.ARM.exidx.exit.text) |
| 70 | *(.ARM.extab.exit.text) |
| 71 | ARM_CPU_DISCARD(*(.ARM.exidx.cpuexit.text)) |
| 72 | ARM_CPU_DISCARD(*(.ARM.extab.cpuexit.text)) |
Russell King | 6760b10 | 2011-09-20 23:35:15 +0100 | [diff] [blame] | 73 | ARM_EXIT_DISCARD(EXIT_TEXT) |
| 74 | ARM_EXIT_DISCARD(EXIT_DATA) |
| 75 | EXIT_CALL |
Russell King | 39df888 | 2011-05-26 11:25:33 +0100 | [diff] [blame] | 76 | #ifndef CONFIG_MMU |
Ard Biesheuvel | c4a84ae | 2015-03-24 10:41:09 +0100 | [diff] [blame] | 77 | *(.text.fixup) |
Russell King | 39df888 | 2011-05-26 11:25:33 +0100 | [diff] [blame] | 78 | *(__ex_table) |
| 79 | #endif |
| 80 | #ifndef CONFIG_SMP_ON_UP |
| 81 | *(.alt.smp.init) |
| 82 | #endif |
Russell King | 6760b10 | 2011-09-20 23:35:15 +0100 | [diff] [blame] | 83 | *(.discard) |
| 84 | *(.discard.*) |
Russell King | 39df888 | 2011-05-26 11:25:33 +0100 | [diff] [blame] | 85 | } |
| 86 | |
Russell King | 9d4f13e | 2006-01-03 17:28:33 +0000 | [diff] [blame] | 87 | #ifdef CONFIG_XIP_KERNEL |
| 88 | . = XIP_VIRT_ADDR(CONFIG_XIP_PHYS_ADDR); |
| 89 | #else |
| 90 | . = PAGE_OFFSET + TEXT_OFFSET; |
| 91 | #endif |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 92 | .head.text : { |
Russell King | e2f8184 | 2011-07-06 10:53:22 +0100 | [diff] [blame] | 93 | _text = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 94 | HEAD_TEXT |
| 95 | } |
Kees Cook | 1e6b481 | 2014-04-03 17:28:11 -0700 | [diff] [blame] | 96 | |
| 97 | #ifdef CONFIG_ARM_KERNMEM_PERMS |
| 98 | . = ALIGN(1<<SECTION_SHIFT); |
| 99 | #endif |
| 100 | |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 101 | .text : { /* Real text segment */ |
Russell King | e2f8184 | 2011-07-06 10:53:22 +0100 | [diff] [blame] | 102 | _stext = .; /* Text and read-only data */ |
Ard Biesheuvel | eb765c1 | 2015-03-18 07:35:01 +0100 | [diff] [blame] | 103 | IDMAP_TEXT |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 104 | __exception_text_start = .; |
| 105 | *(.exception.text) |
| 106 | __exception_text_end = .; |
| 107 | IRQENTRY_TEXT |
| 108 | TEXT_TEXT |
| 109 | SCHED_TEXT |
| 110 | LOCK_TEXT |
| 111 | KPROBES_TEXT |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 112 | *(.gnu.warning) |
| 113 | *(.glue_7) |
| 114 | *(.glue_7t) |
| 115 | . = ALIGN(4); |
| 116 | *(.got) /* Global offset table */ |
| 117 | ARM_CPU_KEEP(PROC_INFO) |
| 118 | } |
| 119 | |
Kees Cook | 80d6b0c | 2014-04-03 13:29:50 -0700 | [diff] [blame] | 120 | #ifdef CONFIG_DEBUG_RODATA |
| 121 | . = ALIGN(1<<SECTION_SHIFT); |
| 122 | #endif |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 123 | RO_DATA(PAGE_SIZE) |
| 124 | |
Stephen Boyd | ee951c6 | 2012-10-29 19:19:34 +0100 | [diff] [blame] | 125 | . = ALIGN(4); |
| 126 | __ex_table : AT(ADDR(__ex_table) - LOAD_OFFSET) { |
| 127 | __start___ex_table = .; |
| 128 | #ifdef CONFIG_MMU |
| 129 | *(__ex_table) |
| 130 | #endif |
| 131 | __stop___ex_table = .; |
| 132 | } |
| 133 | |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 134 | #ifdef CONFIG_ARM_UNWIND |
| 135 | /* |
| 136 | * Stack unwinding tables |
| 137 | */ |
| 138 | . = ALIGN(8); |
| 139 | .ARM.unwind_idx : { |
| 140 | __start_unwind_idx = .; |
| 141 | *(.ARM.exidx*) |
| 142 | __stop_unwind_idx = .; |
| 143 | } |
| 144 | .ARM.unwind_tab : { |
| 145 | __start_unwind_tab = .; |
| 146 | *(.ARM.extab*) |
| 147 | __stop_unwind_tab = .; |
| 148 | } |
| 149 | #endif |
| 150 | |
Pawel Moll | dad5451 | 2012-12-14 16:46:17 +0100 | [diff] [blame] | 151 | NOTES |
| 152 | |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 153 | _etext = .; /* End of text and rodata section */ |
| 154 | |
| 155 | #ifndef CONFIG_XIP_KERNEL |
Kees Cook | 1e6b481 | 2014-04-03 17:28:11 -0700 | [diff] [blame] | 156 | # ifdef CONFIG_ARM_KERNMEM_PERMS |
| 157 | . = ALIGN(1<<SECTION_SHIFT); |
| 158 | # else |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 159 | . = ALIGN(PAGE_SIZE); |
Kees Cook | 1e6b481 | 2014-04-03 17:28:11 -0700 | [diff] [blame] | 160 | # endif |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 161 | __init_begin = .; |
| 162 | #endif |
Russell King | b9b32bf | 2013-07-04 12:03:31 +0100 | [diff] [blame] | 163 | /* |
| 164 | * The vectors and stubs are relocatable code, and the |
| 165 | * only thing that matters is their relative offsets |
| 166 | */ |
| 167 | __vectors_start = .; |
| 168 | .vectors 0 : AT(__vectors_start) { |
| 169 | *(.vectors) |
| 170 | } |
| 171 | . = __vectors_start + SIZEOF(.vectors); |
| 172 | __vectors_end = .; |
| 173 | |
| 174 | __stubs_start = .; |
| 175 | .stubs 0x1000 : AT(__stubs_start) { |
| 176 | *(.stubs) |
| 177 | } |
| 178 | . = __stubs_start + SIZEOF(.stubs); |
| 179 | __stubs_end = .; |
Russell King | 3835d69 | 2011-07-06 10:39:34 +0100 | [diff] [blame] | 180 | |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 181 | INIT_TEXT_SECTION(8) |
| 182 | .exit.text : { |
| 183 | ARM_EXIT_KEEP(EXIT_TEXT) |
| 184 | } |
| 185 | .init.proc.info : { |
Russell King | 5085f3f | 2010-10-01 15:37:05 +0100 | [diff] [blame] | 186 | ARM_CPU_DISCARD(PROC_INFO) |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 187 | } |
| 188 | .init.arch.info : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 189 | __arch_info_begin = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 190 | *(.arch.info.init) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 191 | __arch_info_end = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 192 | } |
| 193 | .init.tagtable : { |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 194 | __tagtable_begin = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 195 | *(.taglist.init) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 196 | __tagtable_end = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 197 | } |
Russell King | f00ec48 | 2010-09-04 10:47:48 +0100 | [diff] [blame] | 198 | #ifdef CONFIG_SMP_ON_UP |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 199 | .init.smpalt : { |
Russell King | f00ec48 | 2010-09-04 10:47:48 +0100 | [diff] [blame] | 200 | __smpalt_begin = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 201 | *(.alt.smp.init) |
Russell King | f00ec48 | 2010-09-04 10:47:48 +0100 | [diff] [blame] | 202 | __smpalt_end = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 203 | } |
Russell King | f00ec48 | 2010-09-04 10:47:48 +0100 | [diff] [blame] | 204 | #endif |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 205 | .init.pv_table : { |
Russell King | dc21af9 | 2011-01-04 19:09:43 +0000 | [diff] [blame] | 206 | __pv_table_begin = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 207 | *(.pv_table) |
Russell King | dc21af9 | 2011-01-04 19:09:43 +0000 | [diff] [blame] | 208 | __pv_table_end = .; |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 209 | } |
| 210 | .init.data : { |
| 211 | #ifndef CONFIG_XIP_KERNEL |
| 212 | INIT_DATA |
| 213 | #endif |
Nelson Elhage | 78d7530 | 2009-10-02 16:32:47 -0400 | [diff] [blame] | 214 | INIT_SETUP(16) |
Nelson Elhage | 78d7530 | 2009-10-02 16:32:47 -0400 | [diff] [blame] | 215 | INIT_CALLS |
| 216 | CON_INITCALL |
| 217 | SECURITY_INITCALL |
| 218 | INIT_RAM_FS |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 219 | } |
Russell King | 1604d79 | 2011-07-05 22:56:41 +0100 | [diff] [blame] | 220 | #ifndef CONFIG_XIP_KERNEL |
| 221 | .exit.data : { |
| 222 | ARM_EXIT_KEEP(EXIT_DATA) |
| 223 | } |
| 224 | #endif |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 225 | |
David Brown | 9973290 | 2012-06-20 22:52:24 +0100 | [diff] [blame] | 226 | #ifdef CONFIG_SMP |
Will Deacon | f0d5375 | 2012-01-20 11:55:54 +0100 | [diff] [blame] | 227 | PERCPU_SECTION(L1_CACHE_BYTES) |
David Brown | 9973290 | 2012-06-20 22:52:24 +0100 | [diff] [blame] | 228 | #endif |
Nelson Elhage | 78d7530 | 2009-10-02 16:32:47 -0400 | [diff] [blame] | 229 | |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 230 | #ifdef CONFIG_XIP_KERNEL |
| 231 | __data_loc = ALIGN(4); /* location in binary */ |
Russell King | 9d4f13e | 2006-01-03 17:28:33 +0000 | [diff] [blame] | 232 | . = PAGE_OFFSET + TEXT_OFFSET; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 233 | #else |
Kees Cook | 1e6b481 | 2014-04-03 17:28:11 -0700 | [diff] [blame] | 234 | #ifdef CONFIG_ARM_KERNMEM_PERMS |
| 235 | . = ALIGN(1<<SECTION_SHIFT); |
| 236 | #else |
Russell King | 4f7a181 | 2005-05-05 13:11:00 +0100 | [diff] [blame] | 237 | . = ALIGN(THREAD_SIZE); |
Kees Cook | 1e6b481 | 2014-04-03 17:28:11 -0700 | [diff] [blame] | 238 | #endif |
Yalin Wang | 562c85c | 2014-09-26 03:30:59 +0100 | [diff] [blame] | 239 | __init_end = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 240 | __data_loc = .; |
| 241 | #endif |
| 242 | |
| 243 | .data : AT(__data_loc) { |
Russell King | 37efe64 | 2008-12-01 11:53:07 +0000 | [diff] [blame] | 244 | _data = .; /* address in memory */ |
Catalin Marinas | 8c7e657 | 2009-05-30 14:00:17 +0100 | [diff] [blame] | 245 | _sdata = .; |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 246 | |
| 247 | /* |
| 248 | * first, the init task union, aligned |
| 249 | * to an 8192 byte boundary. |
| 250 | */ |
Nelson Elhage | 78d7530 | 2009-10-02 16:32:47 -0400 | [diff] [blame] | 251 | INIT_TASK_DATA(THREAD_SIZE) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 252 | |
| 253 | #ifdef CONFIG_XIP_KERNEL |
Linus Walleij | f6430a9 | 2009-06-24 23:38:56 +0100 | [diff] [blame] | 254 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 255 | __init_begin = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 256 | INIT_DATA |
Russell King | a9ad21f | 2011-02-21 10:13:36 +0000 | [diff] [blame] | 257 | ARM_EXIT_KEEP(EXIT_DATA) |
Linus Walleij | f6430a9 | 2009-06-24 23:38:56 +0100 | [diff] [blame] | 258 | . = ALIGN(PAGE_SIZE); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 259 | __init_end = .; |
| 260 | #endif |
| 261 | |
Nelson Elhage | 78d7530 | 2009-10-02 16:32:47 -0400 | [diff] [blame] | 262 | NOSAVE_DATA |
Will Deacon | f0d5375 | 2012-01-20 11:55:54 +0100 | [diff] [blame] | 263 | CACHELINE_ALIGNED_DATA(L1_CACHE_BYTES) |
| 264 | READ_MOSTLY_DATA(L1_CACHE_BYTES) |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 265 | |
| 266 | /* |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 267 | * and the usual data section |
| 268 | */ |
Sam Ravnborg | ca96725 | 2007-05-17 13:38:44 +0200 | [diff] [blame] | 269 | DATA_DATA |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 270 | CONSTRUCTORS |
| 271 | |
| 272 | _edata = .; |
| 273 | } |
Nicolas Pitre | e98ff7f | 2007-02-22 16:18:09 +0100 | [diff] [blame] | 274 | _edata_loc = __data_loc + SIZEOF(.data); |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 275 | |
Linus Walleij | bc58177 | 2009-09-15 17:30:37 +0100 | [diff] [blame] | 276 | #ifdef CONFIG_HAVE_TCM |
| 277 | /* |
| 278 | * We align everything to a page boundary so we can |
| 279 | * free it after init has commenced and TCM contents have |
| 280 | * been copied to its destination. |
| 281 | */ |
| 282 | .tcm_start : { |
| 283 | . = ALIGN(PAGE_SIZE); |
| 284 | __tcm_start = .; |
| 285 | __itcm_start = .; |
| 286 | } |
| 287 | |
| 288 | /* |
| 289 | * Link these to the ITCM RAM |
| 290 | * Put VMA to the TCM address and LMA to the common RAM |
| 291 | * and we'll upload the contents from RAM to TCM and free |
| 292 | * the used RAM after that. |
| 293 | */ |
| 294 | .text_itcm ITCM_OFFSET : AT(__itcm_start) |
| 295 | { |
| 296 | __sitcm_text = .; |
| 297 | *(.tcm.text) |
| 298 | *(.tcm.rodata) |
| 299 | . = ALIGN(4); |
| 300 | __eitcm_text = .; |
| 301 | } |
| 302 | |
| 303 | /* |
| 304 | * Reset the dot pointer, this is needed to create the |
| 305 | * relative __dtcm_start below (to be used as extern in code). |
| 306 | */ |
| 307 | . = ADDR(.tcm_start) + SIZEOF(.tcm_start) + SIZEOF(.text_itcm); |
| 308 | |
| 309 | .dtcm_start : { |
| 310 | __dtcm_start = .; |
| 311 | } |
| 312 | |
| 313 | /* TODO: add remainder of ITCM as well, that can be used for data! */ |
| 314 | .data_dtcm DTCM_OFFSET : AT(__dtcm_start) |
| 315 | { |
| 316 | . = ALIGN(4); |
| 317 | __sdtcm_data = .; |
| 318 | *(.tcm.data) |
| 319 | . = ALIGN(4); |
| 320 | __edtcm_data = .; |
| 321 | } |
| 322 | |
| 323 | /* Reset the dot pointer or the linker gets confused */ |
| 324 | . = ADDR(.dtcm_start) + SIZEOF(.data_dtcm); |
| 325 | |
| 326 | /* End marker for freeing TCM copy in linked object */ |
| 327 | .tcm_end : AT(ADDR(.dtcm_start) + SIZEOF(.data_dtcm)){ |
| 328 | . = ALIGN(PAGE_SIZE); |
| 329 | __tcm_end = .; |
| 330 | } |
| 331 | #endif |
| 332 | |
Nelson Elhage | 78d7530 | 2009-10-02 16:32:47 -0400 | [diff] [blame] | 333 | BSS_SECTION(0, 0, 0) |
| 334 | _end = .; |
| 335 | |
| 336 | STABS_DEBUG |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 337 | } |
| 338 | |
Russell King | 728f5c0 | 2005-11-17 16:43:14 +0000 | [diff] [blame] | 339 | /* |
| 340 | * These must never be empty |
| 341 | * If you have to comment these two assert statements out, your |
| 342 | * binutils is too old (for other reasons as well) |
| 343 | */ |
Linus Torvalds | 1da177e | 2005-04-16 15:20:36 -0700 | [diff] [blame] | 344 | ASSERT((__proc_info_end - __proc_info_begin), "missing CPU support") |
| 345 | ASSERT((__arch_info_end - __arch_info_begin), "no machine record defined") |
Ard Biesheuvel | 06f75a1 | 2015-03-19 16:42:26 +0000 | [diff] [blame] | 346 | |
Marc Zyngier | 0394e1f | 2013-04-12 19:12:04 +0100 | [diff] [blame] | 347 | /* |
Ard Biesheuvel | 06f75a1 | 2015-03-19 16:42:26 +0000 | [diff] [blame] | 348 | * The HYP init code can't be more than a page long, |
| 349 | * and should not cross a page boundary. |
Marc Zyngier | 0394e1f | 2013-04-12 19:12:04 +0100 | [diff] [blame] | 350 | * The above comment applies as well. |
| 351 | */ |
Ard Biesheuvel | 12eb3e8 | 2015-03-24 17:48:07 +0000 | [diff] [blame] | 352 | ASSERT(__hyp_idmap_text_end - (__hyp_idmap_text_start & PAGE_MASK) <= PAGE_SIZE, |
Ard Biesheuvel | 06f75a1 | 2015-03-19 16:42:26 +0000 | [diff] [blame] | 353 | "HYP init code too big or misaligned") |