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