Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
| 2 | * File: arch/blackfin/kernel/vmlinux.lds.S |
| 3 | * Based on: none - original work |
| 4 | * Author: |
| 5 | * |
| 6 | * Created: Tue Sep 21 2004 |
| 7 | * Description: Master linker script for blackfin architecture |
| 8 | * |
| 9 | * Modified: |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 10 | * Copyright 2004-2007 Analog Devices Inc. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 11 | * |
| 12 | * Bugs: Enter bugs at http://blackfin.uclinux.org/ |
| 13 | * |
| 14 | * This program is free software; you can redistribute it and/or modify |
| 15 | * it under the terms of the GNU General Public License as published by |
| 16 | * the Free Software Foundation; either version 2 of the License, or |
| 17 | * (at your option) any later version. |
| 18 | * |
| 19 | * This program is distributed in the hope that it will be useful, |
| 20 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 21 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 22 | * GNU General Public License for more details. |
| 23 | * |
| 24 | * You should have received a copy of the GNU General Public License |
| 25 | * along with this program; if not, see the file COPYING, or write |
| 26 | * to the Free Software Foundation, Inc., |
| 27 | * 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
| 28 | */ |
| 29 | |
| 30 | #define VMLINUX_SYMBOL(_sym_) _##_sym_ |
| 31 | |
| 32 | #include <asm-generic/vmlinux.lds.h> |
| 33 | #include <asm/mem_map.h> |
Mike Frysinger | 520473b | 2007-07-12 12:20:20 +0800 | [diff] [blame] | 34 | #include <asm/page.h> |
Bernd Schmidt | 0fa63ad | 2007-07-25 10:19:59 +0800 | [diff] [blame] | 35 | #include <asm/thread_info.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 36 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 37 | OUTPUT_FORMAT("elf32-bfin") |
| 38 | ENTRY(__start) |
| 39 | _jiffies = _jiffies_64; |
| 40 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 41 | SECTIONS |
| 42 | { |
| 43 | . = CONFIG_BOOT_LOAD; |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 44 | /* Neither the text, ro_data or bss section need to be aligned |
| 45 | * So pack them back to back |
| 46 | */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 47 | .text : |
| 48 | { |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 49 | __text = .; |
| 50 | _text = .; |
| 51 | __stext = .; |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 52 | TEXT_TEXT |
Robin Getz | b8d0c77 | 2009-03-31 13:40:52 +0000 | [diff] [blame] | 53 | #ifndef CONFIG_SCHEDULE_L1 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 54 | SCHED_TEXT |
Robin Getz | b8d0c77 | 2009-03-31 13:40:52 +0000 | [diff] [blame] | 55 | #endif |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 56 | LOCK_TEXT |
Mike Frysinger | 1ee76d7 | 2009-06-10 04:45:29 -0400 | [diff] [blame^] | 57 | IRQENTRY_TEXT |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 58 | KPROBES_TEXT |
| 59 | *(.text.*) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 60 | *(.fixup) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 61 | |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 62 | #if !L1_CODE_LENGTH |
| 63 | *(.l1.text) |
| 64 | #endif |
| 65 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 66 | . = ALIGN(16); |
| 67 | ___start___ex_table = .; |
| 68 | *(__ex_table) |
| 69 | ___stop___ex_table = .; |
| 70 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 71 | __etext = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 72 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 73 | |
Bernd Schmidt | 6f98529 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 74 | NOTES |
| 75 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 76 | /* Just in case the first read only is a 32-bit access */ |
| 77 | RO_DATA(4) |
| 78 | |
| 79 | .bss : |
| 80 | { |
| 81 | . = ALIGN(4); |
| 82 | ___bss_start = .; |
| 83 | *(.bss .bss.*) |
| 84 | *(COMMON) |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 85 | #if !L1_DATA_A_LENGTH |
| 86 | *(.l1.bss) |
| 87 | #endif |
| 88 | #if !L1_DATA_B_LENGTH |
| 89 | *(.l1.bss.B) |
| 90 | #endif |
Mike Frysinger | 1375204 | 2008-08-06 17:10:57 +0800 | [diff] [blame] | 91 | . = ALIGN(4); |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 92 | ___bss_stop = .; |
| 93 | } |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 94 | |
| 95 | .data : |
| 96 | { |
| 97 | __sdata = .; |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 98 | /* This gets done first, so the glob doesn't suck it in */ |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 99 | . = ALIGN(32); |
| 100 | *(.data.cacheline_aligned) |
| 101 | |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 102 | #if !L1_DATA_A_LENGTH |
| 103 | . = ALIGN(32); |
| 104 | *(.data_l1.cacheline_aligned) |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 105 | *(.l1.data) |
| 106 | #endif |
| 107 | #if !L1_DATA_B_LENGTH |
| 108 | *(.l1.data.B) |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 109 | #endif |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 110 | #if !L2_LENGTH |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 111 | . = ALIGN(32); |
| 112 | *(.data_l2.cacheline_aligned) |
| 113 | *(.l2.data) |
| 114 | #endif |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 115 | |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 116 | DATA_DATA |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 117 | CONSTRUCTORS |
| 118 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 119 | /* make sure the init_task is aligned to the |
| 120 | * kernel thread size so we can locate the kernel |
| 121 | * stack properly and quickly. |
| 122 | */ |
Bernd Schmidt | 0fa63ad | 2007-07-25 10:19:59 +0800 | [diff] [blame] | 123 | . = ALIGN(THREAD_SIZE); |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 124 | *(.init_task.data) |
| 125 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 126 | __edata = .; |
| 127 | } |
| 128 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 129 | /* The init section should be last, so when we free it, it goes into |
| 130 | * the general memory pool, and (hopefully) will decrease fragmentation |
| 131 | * a tiny bit. The init section has a _requirement_ that it be |
| 132 | * PAGE_SIZE aligned |
| 133 | */ |
| 134 | . = ALIGN(PAGE_SIZE); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 135 | ___init_begin = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 136 | |
| 137 | .init.text : |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 138 | { |
Bernd Schmidt | 0fa63ad | 2007-07-25 10:19:59 +0800 | [diff] [blame] | 139 | . = ALIGN(PAGE_SIZE); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 140 | __sinittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 141 | INIT_TEXT |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 142 | __einittext = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 143 | } |
| 144 | .init.data : |
| 145 | { |
| 146 | . = ALIGN(16); |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 147 | INIT_DATA |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 148 | } |
| 149 | .init.setup : |
| 150 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 151 | . = ALIGN(16); |
| 152 | ___setup_start = .; |
| 153 | *(.init.setup) |
| 154 | ___setup_end = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 155 | } |
| 156 | .initcall.init : |
| 157 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 158 | ___initcall_start = .; |
| 159 | INITCALLS |
| 160 | ___initcall_end = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 161 | } |
| 162 | .con_initcall.init : |
| 163 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 164 | ___con_initcall_start = .; |
| 165 | *(.con_initcall.init) |
| 166 | ___con_initcall_end = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 167 | } |
Graf Yang | 46fa5ee | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 168 | PERCPU(4) |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 169 | SECURITY_INIT |
Mike Frysinger | 70f1256 | 2009-06-07 17:18:25 -0400 | [diff] [blame] | 170 | |
| 171 | /* we have to discard exit text and such at runtime, not link time, to |
| 172 | * handle embedded cross-section references (alt instructions, bug |
| 173 | * table, eh_frame, etc...) |
| 174 | */ |
| 175 | .exit.text : |
| 176 | { |
| 177 | EXIT_TEXT |
| 178 | } |
| 179 | .exit.data : |
| 180 | { |
| 181 | EXIT_DATA |
| 182 | } |
| 183 | |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 184 | .init.ramfs : |
| 185 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 186 | . = ALIGN(4); |
| 187 | ___initramfs_start = .; |
| 188 | *(.init.ramfs) |
Bernd Schmidt | 6f98529 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 189 | . = ALIGN(4); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 190 | ___initramfs_end = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 191 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 192 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 193 | __l1_lma_start = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 194 | |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 195 | .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs)) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 196 | { |
| 197 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 198 | __stext_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 199 | *(.l1.text) |
Robin Getz | b8d0c77 | 2009-03-31 13:40:52 +0000 | [diff] [blame] | 200 | #ifdef CONFIG_SCHEDULE_L1 |
| 201 | SCHED_TEXT |
| 202 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 203 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 204 | __etext_l1 = .; |
| 205 | } |
Mike Frysinger | 4636b30 | 2009-03-29 00:47:31 +0800 | [diff] [blame] | 206 | ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!") |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 207 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 208 | .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1)) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 209 | { |
| 210 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 211 | __sdata_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 212 | *(.l1.data) |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 213 | __edata_l1 = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 214 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 215 | . = ALIGN(32); |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 216 | *(.data_l1.cacheline_aligned) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 217 | |
| 218 | . = ALIGN(4); |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 219 | __sbss_l1 = .; |
| 220 | *(.l1.bss) |
| 221 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 222 | __ebss_l1 = .; |
| 223 | } |
Mike Frysinger | 4636b30 | 2009-03-29 00:47:31 +0800 | [diff] [blame] | 224 | ASSERT (SIZEOF(.data_a_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!") |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 225 | |
| 226 | .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 227 | { |
| 228 | . = ALIGN(4); |
| 229 | __sdata_b_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 230 | *(.l1.data.B) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 231 | __edata_b_l1 = .; |
| 232 | |
| 233 | . = ALIGN(4); |
| 234 | __sbss_b_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 235 | *(.l1.bss.B) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 236 | . = ALIGN(4); |
| 237 | __ebss_b_l1 = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 238 | } |
Mike Frysinger | 4636b30 | 2009-03-29 00:47:31 +0800 | [diff] [blame] | 239 | ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!") |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 240 | |
Bernd Schmidt | 6f98529 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 241 | __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 242 | |
| 243 | .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1)) |
| 244 | { |
| 245 | . = ALIGN(4); |
| 246 | __stext_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 247 | *(.l2.text) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 248 | . = ALIGN(4); |
| 249 | __etext_l2 = .; |
| 250 | |
| 251 | . = ALIGN(4); |
| 252 | __sdata_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 253 | *(.l2.data) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 254 | __edata_l2 = .; |
| 255 | |
| 256 | . = ALIGN(32); |
| 257 | *(.data_l2.cacheline_aligned) |
| 258 | |
| 259 | . = ALIGN(4); |
| 260 | __sbss_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 261 | *(.l2.bss) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 262 | . = ALIGN(4); |
| 263 | __ebss_l2 = .; |
| 264 | } |
Mike Frysinger | 4636b30 | 2009-03-29 00:47:31 +0800 | [diff] [blame] | 265 | ASSERT (SIZEOF(.text_data_l1) <= L2_LENGTH, "L2 overflow!") |
Bernd Schmidt | 6f98529 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 266 | |
Mike Frysinger | 3620805 | 2007-10-30 12:00:02 +0800 | [diff] [blame] | 267 | /* Force trailing alignment of our init section so that when we |
| 268 | * free our init memory, we don't leave behind a partial page. |
| 269 | */ |
Bernd Schmidt | 6f98529 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 270 | . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2); |
Mike Frysinger | 3620805 | 2007-10-30 12:00:02 +0800 | [diff] [blame] | 271 | . = ALIGN(PAGE_SIZE); |
| 272 | ___init_end = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 273 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 274 | __end =.; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 275 | |
Mike Frysinger | c11b577 | 2007-10-11 00:12:41 +0800 | [diff] [blame] | 276 | STABS_DEBUG |
| 277 | |
| 278 | DWARF_DEBUG |
| 279 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 280 | /DISCARD/ : |
| 281 | { |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 282 | *(.exitcall.exit) |
| 283 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 284 | } |