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 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 53 | SCHED_TEXT |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 54 | LOCK_TEXT |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 55 | KPROBES_TEXT |
| 56 | *(.text.*) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 57 | *(.fixup) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 58 | |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 59 | #if !L1_CODE_LENGTH |
| 60 | *(.l1.text) |
| 61 | #endif |
| 62 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 63 | . = ALIGN(16); |
| 64 | ___start___ex_table = .; |
| 65 | *(__ex_table) |
| 66 | ___stop___ex_table = .; |
| 67 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 68 | __etext = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 69 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 70 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 71 | /* Just in case the first read only is a 32-bit access */ |
| 72 | RO_DATA(4) |
| 73 | |
| 74 | .bss : |
| 75 | { |
| 76 | . = ALIGN(4); |
| 77 | ___bss_start = .; |
| 78 | *(.bss .bss.*) |
| 79 | *(COMMON) |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 80 | #if !L1_DATA_A_LENGTH |
| 81 | *(.l1.bss) |
| 82 | #endif |
| 83 | #if !L1_DATA_B_LENGTH |
| 84 | *(.l1.bss.B) |
| 85 | #endif |
Mike Frysinger | 1375204 | 2008-08-06 17:10:57 +0800 | [diff] [blame] | 86 | . = ALIGN(4); |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 87 | ___bss_stop = .; |
| 88 | } |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 89 | |
| 90 | .data : |
| 91 | { |
| 92 | __sdata = .; |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 93 | /* This gets done first, so the glob doesn't suck it in */ |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 94 | . = ALIGN(32); |
| 95 | *(.data.cacheline_aligned) |
| 96 | |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 97 | #if !L1_DATA_A_LENGTH |
| 98 | . = ALIGN(32); |
| 99 | *(.data_l1.cacheline_aligned) |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 100 | *(.l1.data) |
| 101 | #endif |
| 102 | #if !L1_DATA_B_LENGTH |
| 103 | *(.l1.data.B) |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 104 | #endif |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame^] | 105 | #if !L2_LENGTH |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 106 | . = ALIGN(32); |
| 107 | *(.data_l2.cacheline_aligned) |
| 108 | *(.l2.data) |
| 109 | #endif |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 110 | |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 111 | DATA_DATA |
| 112 | *(.data.*) |
| 113 | CONSTRUCTORS |
| 114 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 115 | /* make sure the init_task is aligned to the |
| 116 | * kernel thread size so we can locate the kernel |
| 117 | * stack properly and quickly. |
| 118 | */ |
Bernd Schmidt | 0fa63ad | 2007-07-25 10:19:59 +0800 | [diff] [blame] | 119 | . = ALIGN(THREAD_SIZE); |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 120 | *(.init_task.data) |
| 121 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 122 | __edata = .; |
| 123 | } |
| 124 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 125 | /* The init section should be last, so when we free it, it goes into |
| 126 | * the general memory pool, and (hopefully) will decrease fragmentation |
| 127 | * a tiny bit. The init section has a _requirement_ that it be |
| 128 | * PAGE_SIZE aligned |
| 129 | */ |
| 130 | . = ALIGN(PAGE_SIZE); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 131 | ___init_begin = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 132 | |
| 133 | .init.text : |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 134 | { |
Bernd Schmidt | 0fa63ad | 2007-07-25 10:19:59 +0800 | [diff] [blame] | 135 | . = ALIGN(PAGE_SIZE); |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 136 | __sinittext = .; |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 137 | INIT_TEXT |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 138 | __einittext = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 139 | } |
| 140 | .init.data : |
| 141 | { |
| 142 | . = ALIGN(16); |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 143 | INIT_DATA |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 144 | } |
| 145 | .init.setup : |
| 146 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 147 | . = ALIGN(16); |
| 148 | ___setup_start = .; |
| 149 | *(.init.setup) |
| 150 | ___setup_end = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 151 | } |
| 152 | .initcall.init : |
| 153 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 154 | ___initcall_start = .; |
| 155 | INITCALLS |
| 156 | ___initcall_end = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 157 | } |
| 158 | .con_initcall.init : |
| 159 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 160 | ___con_initcall_start = .; |
| 161 | *(.con_initcall.init) |
| 162 | ___con_initcall_end = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 163 | } |
| 164 | SECURITY_INIT |
| 165 | .init.ramfs : |
| 166 | { |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 167 | . = ALIGN(4); |
| 168 | ___initramfs_start = .; |
| 169 | *(.init.ramfs) |
| 170 | ___initramfs_end = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 171 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 172 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 173 | __l1_lma_start = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 174 | |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 175 | .text_l1 L1_CODE_START : AT(LOADADDR(.init.ramfs) + SIZEOF(.init.ramfs)) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 176 | { |
| 177 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 178 | __stext_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 179 | *(.l1.text) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 180 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 181 | __etext_l1 = .; |
| 182 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 183 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 184 | .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] | 185 | { |
| 186 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 187 | __sdata_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 188 | *(.l1.data) |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 189 | __edata_l1 = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 190 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 191 | . = ALIGN(32); |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 192 | *(.data_l1.cacheline_aligned) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 193 | |
| 194 | . = ALIGN(4); |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 195 | __sbss_l1 = .; |
| 196 | *(.l1.bss) |
| 197 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 198 | __ebss_l1 = .; |
| 199 | } |
| 200 | |
| 201 | .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] | 202 | { |
| 203 | . = ALIGN(4); |
| 204 | __sdata_b_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 205 | *(.l1.data.B) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 206 | __edata_b_l1 = .; |
| 207 | |
| 208 | . = ALIGN(4); |
| 209 | __sbss_b_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 210 | *(.l1.bss.B) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 211 | . = ALIGN(4); |
| 212 | __ebss_b_l1 = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 213 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 214 | |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 215 | __l2_lma_start = .; |
| 216 | |
| 217 | .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1)) |
| 218 | { |
| 219 | . = ALIGN(4); |
| 220 | __stext_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame^] | 221 | *(.l2.text) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 222 | . = ALIGN(4); |
| 223 | __etext_l2 = .; |
| 224 | |
| 225 | . = ALIGN(4); |
| 226 | __sdata_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame^] | 227 | *(.l2.data) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 228 | __edata_l2 = .; |
| 229 | |
| 230 | . = ALIGN(32); |
| 231 | *(.data_l2.cacheline_aligned) |
| 232 | |
| 233 | . = ALIGN(4); |
| 234 | __sbss_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame^] | 235 | *(.l2.bss) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 236 | . = ALIGN(4); |
| 237 | __ebss_l2 = .; |
| 238 | } |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 239 | |
Mike Frysinger | 3620805 | 2007-10-30 12:00:02 +0800 | [diff] [blame] | 240 | /* Force trailing alignment of our init section so that when we |
| 241 | * free our init memory, we don't leave behind a partial page. |
| 242 | */ |
| 243 | . = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); |
| 244 | . = ALIGN(PAGE_SIZE); |
| 245 | ___init_end = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 246 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 247 | __end =.; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 248 | |
Mike Frysinger | c11b577 | 2007-10-11 00:12:41 +0800 | [diff] [blame] | 249 | STABS_DEBUG |
| 250 | |
| 251 | DWARF_DEBUG |
| 252 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 253 | /DISCARD/ : |
| 254 | { |
Sam Ravnborg | 01ba2bd | 2008-01-20 14:15:03 +0100 | [diff] [blame] | 255 | EXIT_TEXT |
| 256 | EXIT_DATA |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 257 | *(.exitcall.exit) |
| 258 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 259 | } |