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