aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/kernel/vmlinux.lds.S
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2009-09-23 16:34:48 -0400
committerMike Frysinger <vapier@gentoo.org>2009-12-15 00:13:55 -0500
commit5cd82a6d58cb14c3a5d08ed171229de7adc3deac (patch)
tree3e72b56fef6e99ab2032d88138440b57543e3c02 /arch/blackfin/kernel/vmlinux.lds.S
parent13048f8866390a26a7b657e0ca28100e2660063a (diff)
Blackfin: calculate on-chip lengths at link time rather than run time
Since the link sizes never change at runtime, push the calculation out to the linker script to save some useless calculation costs. Signed-off-by: Mike Frysinger <vapier@gentoo.org>
Diffstat (limited to 'arch/blackfin/kernel/vmlinux.lds.S')
-rw-r--r--arch/blackfin/kernel/vmlinux.lds.S28
1 files changed, 16 insertions, 12 deletions
diff --git a/arch/blackfin/kernel/vmlinux.lds.S b/arch/blackfin/kernel/vmlinux.lds.S
index 10e12539000e..01682eed771e 100644
--- a/arch/blackfin/kernel/vmlinux.lds.S
+++ b/arch/blackfin/kernel/vmlinux.lds.S
@@ -123,8 +123,6 @@ SECTIONS
123 EXIT_DATA 123 EXIT_DATA
124 } 124 }
125 125
126 __l1_lma_start = .;
127
128 .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data)) 126 .text_l1 L1_CODE_START : AT(LOADADDR(.exit.data) + SIZEOF(.exit.data))
129 { 127 {
130 . = ALIGN(4); 128 . = ALIGN(4);
@@ -136,9 +134,11 @@ SECTIONS
136 . = ALIGN(4); 134 . = ALIGN(4);
137 __etext_l1 = .; 135 __etext_l1 = .;
138 } 136 }
139 ASSERT (SIZEOF(.text_l1) <= L1_CODE_LENGTH, "L1 text overflow!") 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!")
140 140
141 .data_l1 L1_DATA_A_START : AT(LOADADDR(.text_l1) + SIZEOF(.text_l1)) 141 .data_l1 L1_DATA_A_START : AT(__text_l1_lma + __text_l1_len)
142 { 142 {
143 . = ALIGN(4); 143 . = ALIGN(4);
144 __sdata_l1 = .; 144 __sdata_l1 = .;
@@ -154,9 +154,11 @@ SECTIONS
154 . = ALIGN(4); 154 . = ALIGN(4);
155 __ebss_l1 = .; 155 __ebss_l1 = .;
156 } 156 }
157 ASSERT (SIZEOF(.data_l1) <= L1_DATA_A_LENGTH, "L1 data A overflow!") 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!")
158 160
159 .data_b_l1 L1_DATA_B_START : AT(LOADADDR(.data_l1) + SIZEOF(.data_l1)) 161 .data_b_l1 L1_DATA_B_START : AT(__data_l1_lma + __data_l1_len)
160 { 162 {
161 . = ALIGN(4); 163 . = ALIGN(4);
162 __sdata_b_l1 = .; 164 __sdata_b_l1 = .;
@@ -169,11 +171,11 @@ SECTIONS
169 . = ALIGN(4); 171 . = ALIGN(4);
170 __ebss_b_l1 = .; 172 __ebss_b_l1 = .;
171 } 173 }
172 ASSERT (SIZEOF(.data_b_l1) <= L1_DATA_B_LENGTH, "L1 data B overflow!") 174 __data_b_l1_lma = LOADADDR(.data_b_l1);
173 175 __data_b_l1_len = SIZEOF(.data_b_l1);
174 __l2_lma_start = LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1); 176 ASSERT (__data_b_l1_len <= L1_DATA_B_LENGTH, "L1 data B overflow!")
175 177
176 .text_data_l2 L2_START : AT(LOADADDR(.data_b_l1) + SIZEOF(.data_b_l1)) 178 .text_data_l2 L2_START : AT(__data_b_l1_lma + __data_b_l1_len)
177 { 179 {
178 . = ALIGN(4); 180 . = ALIGN(4);
179 __stext_l2 = .; 181 __stext_l2 = .;
@@ -195,12 +197,14 @@ SECTIONS
195 . = ALIGN(4); 197 . = ALIGN(4);
196 __ebss_l2 = .; 198 __ebss_l2 = .;
197 } 199 }
198 ASSERT (SIZEOF(.text_data_l2) <= L2_LENGTH, "L2 overflow!") 200 __l2_lma = LOADADDR(.text_data_l2);
201 __l2_len = SIZEOF(.text_data_l2);
202 ASSERT (__l2_len <= L2_LENGTH, "L2 overflow!")
199 203
200 /* Force trailing alignment of our init section so that when we 204 /* Force trailing alignment of our init section so that when we
201 * free our init memory, we don't leave behind a partial page. 205 * free our init memory, we don't leave behind a partial page.
202 */ 206 */
203 . = LOADADDR(.text_data_l2) + SIZEOF(.text_data_l2); 207 . = __l2_lma + __l2_len;
204 . = ALIGN(PAGE_SIZE); 208 . = ALIGN(PAGE_SIZE);
205 ___init_end = .; 209 ___init_end = .;
206 210