Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 1 | /* |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 2 | * Copyright 2004-2009 Analog Devices Inc. |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 3 | * |
Robin Getz | 96f1050 | 2009-09-24 14:11:24 +0000 | [diff] [blame] | 4 | * Licensed under the GPL-2 or later |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 5 | */ |
| 6 | |
| 7 | #define VMLINUX_SYMBOL(_sym_) _##_sym_ |
| 8 | |
| 9 | #include <asm-generic/vmlinux.lds.h> |
| 10 | #include <asm/mem_map.h> |
Mike Frysinger | 520473b | 2007-07-12 12:20:20 +0800 | [diff] [blame] | 11 | #include <asm/page.h> |
Bernd Schmidt | 0fa63ad | 2007-07-25 10:19:59 +0800 | [diff] [blame] | 12 | #include <asm/thread_info.h> |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 13 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 14 | OUTPUT_FORMAT("elf32-bfin") |
| 15 | ENTRY(__start) |
| 16 | _jiffies = _jiffies_64; |
| 17 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 18 | SECTIONS |
| 19 | { |
| 20 | . = CONFIG_BOOT_LOAD; |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 21 | /* Neither the text, ro_data or bss section need to be aligned |
| 22 | * So pack them back to back |
| 23 | */ |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 24 | .text : |
| 25 | { |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 26 | __text = .; |
| 27 | _text = .; |
| 28 | __stext = .; |
Sam Ravnborg | 7664709 | 2007-05-13 00:31:33 +0200 | [diff] [blame] | 29 | TEXT_TEXT |
Robin Getz | b8d0c77 | 2009-03-31 13:40:52 +0000 | [diff] [blame] | 30 | #ifndef CONFIG_SCHEDULE_L1 |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 31 | SCHED_TEXT |
Robin Getz | b8d0c77 | 2009-03-31 13:40:52 +0000 | [diff] [blame] | 32 | #endif |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 33 | LOCK_TEXT |
Mike Frysinger | 1ee76d7 | 2009-06-10 04:45:29 -0400 | [diff] [blame] | 34 | IRQENTRY_TEXT |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 35 | KPROBES_TEXT |
| 36 | *(.text.*) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 37 | *(.fixup) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 38 | |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 39 | #if !L1_CODE_LENGTH |
| 40 | *(.l1.text) |
| 41 | #endif |
| 42 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 43 | . = ALIGN(16); |
| 44 | ___start___ex_table = .; |
| 45 | *(__ex_table) |
| 46 | ___stop___ex_table = .; |
| 47 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 48 | __etext = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 49 | } |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 50 | |
Bernd Schmidt | 6f98529 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 51 | NOTES |
| 52 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 53 | /* Just in case the first read only is a 32-bit access */ |
| 54 | RO_DATA(4) |
| 55 | |
| 56 | .bss : |
| 57 | { |
| 58 | . = ALIGN(4); |
| 59 | ___bss_start = .; |
| 60 | *(.bss .bss.*) |
| 61 | *(COMMON) |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 62 | #if !L1_DATA_A_LENGTH |
| 63 | *(.l1.bss) |
| 64 | #endif |
| 65 | #if !L1_DATA_B_LENGTH |
| 66 | *(.l1.bss.B) |
| 67 | #endif |
Mike Frysinger | 1375204 | 2008-08-06 17:10:57 +0800 | [diff] [blame] | 68 | . = ALIGN(4); |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 69 | ___bss_stop = .; |
| 70 | } |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 71 | |
| 72 | .data : |
| 73 | { |
| 74 | __sdata = .; |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 75 | /* This gets done first, so the glob doesn't suck it in */ |
Tim Abbott | 4a5e351 | 2009-09-24 10:36:23 -0400 | [diff] [blame] | 76 | CACHELINE_ALIGNED_DATA(32) |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 77 | |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 78 | #if !L1_DATA_A_LENGTH |
| 79 | . = ALIGN(32); |
| 80 | *(.data_l1.cacheline_aligned) |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 81 | *(.l1.data) |
| 82 | #endif |
| 83 | #if !L1_DATA_B_LENGTH |
| 84 | *(.l1.data.B) |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 85 | #endif |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 86 | #if !L2_LENGTH |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 87 | . = ALIGN(32); |
| 88 | *(.data_l2.cacheline_aligned) |
| 89 | *(.l2.data) |
| 90 | #endif |
Sonic Zhang | b85b82d | 2008-04-24 06:13:37 +0800 | [diff] [blame] | 91 | |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 92 | DATA_DATA |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 93 | CONSTRUCTORS |
| 94 | |
Tim Abbott | 4a5e351 | 2009-09-24 10:36:23 -0400 | [diff] [blame] | 95 | INIT_TASK_DATA(THREAD_SIZE) |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 96 | |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 97 | __edata = .; |
| 98 | } |
| 99 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 100 | /* The init section should be last, so when we free it, it goes into |
| 101 | * the general memory pool, and (hopefully) will decrease fragmentation |
| 102 | * a tiny bit. The init section has a _requirement_ that it be |
| 103 | * PAGE_SIZE aligned |
| 104 | */ |
| 105 | . = ALIGN(PAGE_SIZE); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 106 | ___init_begin = .; |
Mike Frysinger | 27d875f | 2007-08-27 16:08:53 +0800 | [diff] [blame] | 107 | |
Tim Abbott | 4a5e351 | 2009-09-24 10:36:23 -0400 | [diff] [blame] | 108 | INIT_TEXT_SECTION(PAGE_SIZE) |
| 109 | . = ALIGN(16); |
| 110 | INIT_DATA_SECTION(16) |
Graf Yang | 46fa5ee | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 111 | PERCPU(4) |
Mike Frysinger | 70f1256 | 2009-06-07 17:18:25 -0400 | [diff] [blame] | 112 | |
| 113 | /* we have to discard exit text and such at runtime, not link time, to |
| 114 | * handle embedded cross-section references (alt instructions, bug |
| 115 | * table, eh_frame, etc...) |
| 116 | */ |
| 117 | .exit.text : |
| 118 | { |
| 119 | EXIT_TEXT |
| 120 | } |
| 121 | .exit.data : |
| 122 | { |
| 123 | EXIT_DATA |
| 124 | } |
| 125 | |
Tim Abbott | 4a5e351 | 2009-09-24 10:36:23 -0400 | [diff] [blame] | 126 | .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data)) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 127 | { |
| 128 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 129 | __stext_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 130 | *(.l1.text) |
Robin Getz | b8d0c77 | 2009-03-31 13:40:52 +0000 | [diff] [blame] | 131 | #ifdef CONFIG_SCHEDULE_L1 |
| 132 | SCHED_TEXT |
| 133 | #endif |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 134 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 135 | __etext_l1 = .; |
| 136 | } |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 137 | __text_l1_lma = LOADADDR(.text_l1); |
| 138 | __text_l1_len = SIZEOF(.text_l1); |
| 139 | ASSERT (__text_l1_len <= L1_CODE_LENGTH, "L1 text overflow!") |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 140 | |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 141 | .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 142 | { |
| 143 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 144 | __sdata_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 145 | *(.l1.data) |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 146 | __edata_l1 = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 147 | |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 148 | . = ALIGN(32); |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 149 | *(.data_l1.cacheline_aligned) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 150 | |
| 151 | . = ALIGN(4); |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 152 | __sbss_l1 = .; |
| 153 | *(.l1.bss) |
| 154 | . = ALIGN(4); |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 155 | __ebss_l1 = .; |
| 156 | } |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 157 | __data_l1_lma = LOADADDR(.data_l1); |
| 158 | __data_l1_len = SIZEOF(.data_l1); |
| 159 | ASSERT (__data_l1_len <= L1_DATA_A_LENGTH, "L1 data A overflow!") |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 160 | |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 161 | .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 162 | { |
| 163 | . = ALIGN(4); |
| 164 | __sdata_b_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 165 | *(.l1.data.B) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 166 | __edata_b_l1 = .; |
| 167 | |
| 168 | . = ALIGN(4); |
| 169 | __sbss_b_l1 = .; |
Mike Frysinger | bc6e0fa | 2008-04-24 06:21:25 +0800 | [diff] [blame] | 170 | *(.l1.bss.B) |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 171 | . = ALIGN(4); |
| 172 | __ebss_b_l1 = .; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 173 | } |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 174 | __data_b_l1_lma = LOADADDR(.data_b_l1); |
| 175 | __data_b_l1_len = SIZEOF(.data_b_l1); |
| 176 | ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!") |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 177 | |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 178 | .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 179 | { |
| 180 | . = ALIGN(4); |
| 181 | __stext_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 182 | *(.l2.text) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 183 | . = ALIGN(4); |
| 184 | __etext_l2 = .; |
| 185 | |
| 186 | . = ALIGN(4); |
| 187 | __sdata_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 188 | *(.l2.data) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 189 | __edata_l2 = .; |
| 190 | |
| 191 | . = ALIGN(32); |
| 192 | *(.data_l2.cacheline_aligned) |
| 193 | |
| 194 | . = ALIGN(4); |
| 195 | __sbss_l2 = .; |
Mike Frysinger | 07aa7be | 2008-08-13 16:16:11 +0800 | [diff] [blame] | 196 | *(.l2.bss) |
Sonic Zhang | 262c382 | 2008-07-19 15:42:41 +0800 | [diff] [blame] | 197 | . = ALIGN(4); |
| 198 | __ebss_l2 = .; |
| 199 | } |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 200 | __l2_lma = LOADADDR(.text_data_l2); |
| 201 | __l2_len = SIZEOF(.text_data_l2); |
| 202 | ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!") |
Bernd Schmidt | 6f98529 | 2009-01-07 23:14:39 +0800 | [diff] [blame] | 203 | |
Mike Frysinger | 3620805 | 2007-10-30 12:00:02 +0800 | [diff] [blame] | 204 | /* Force trailing alignment of our init section so that when we |
| 205 | * free our init memory, we don't leave behind a partial page. |
| 206 | */ |
Mike Frysinger | 5cd82a6 | 2009-09-23 20:34:48 +0000 | [diff] [blame^] | 207 | . = __l2_lma + __l2_len; |
Mike Frysinger | 3620805 | 2007-10-30 12:00:02 +0800 | [diff] [blame] | 208 | . = ALIGN(PAGE_SIZE); |
| 209 | ___init_end = .; |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 210 | |
Mike Frysinger | b7627ac | 2008-02-02 15:53:17 +0800 | [diff] [blame] | 211 | __end =.; |
Mike Frysinger | de6a952 | 2007-06-11 17:27:05 +0800 | [diff] [blame] | 212 | |
Mike Frysinger | c11b577 | 2007-10-11 00:12:41 +0800 | [diff] [blame] | 213 | STABS_DEBUG |
| 214 | |
| 215 | DWARF_DEBUG |
| 216 | |
Tejun Heo | 023bf6f | 2009-07-09 11:27:40 +0900 | [diff] [blame] | 217 | DISCARDS |
Bryan Wu | 1394f03 | 2007-05-06 14:50:22 -0700 | [diff] [blame] | 218 | } |