diff options
author | Michael Sevakis <jethead71@rockbox.org> | 2013-07-10 22:30:50 -0400 |
---|---|---|
committer | Michael Sevakis <jethead71@rockbox.org> | 2013-07-10 22:37:17 -0400 |
commit | 5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f (patch) | |
tree | 2ecea9b02401dc188ca8e67bbad614e29956db0e /apps | |
parent | 18f9486e3bdaaa506e24b3e1db09e970946abbdc (diff) | |
download | rockbox-5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f.tar.gz rockbox-5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f.zip |
Fix .ncbss from possibly overlapping .ncdata in plugins/codecs.
If .bss wasn't large enough, and .ncdata was empty, .ncbss would be
at an address overlapping the alignment-padded end of .ncdata and
and linking would fail with an overlap error.
There also should no longer be an issue that needs special correction
with iramcopy and empty .bss. The .maps look good in that case.
Change-Id: I02bf73a0acef2c0c04b5d135ecf4e18fb97ee339
Diffstat (limited to 'apps')
-rw-r--r-- | apps/plugins/plugin.lds | 65 |
1 files changed, 30 insertions, 35 deletions
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds index 10ce98fca4..d5cfaae406 100644 --- a/apps/plugins/plugin.lds +++ b/apps/plugins/plugin.lds | |||
@@ -247,16 +247,15 @@ SECTIONS | |||
247 | { | 247 | { |
248 | *(.rodata*) | 248 | *(.rodata*) |
249 | #if defined(IRAMSIZE) && IRAMSIZE == 0 | 249 | #if defined(IRAMSIZE) && IRAMSIZE == 0 |
250 | *(.irodata) | 250 | *(.irodata) |
251 | #endif | 251 | #endif |
252 | . = ALIGN(0x4); | ||
253 | } > PLUGIN_RAM | 252 | } > PLUGIN_RAM |
254 | 253 | ||
255 | .data : | 254 | .data : |
256 | { | 255 | { |
257 | *(.data*) | 256 | *(.data*) |
258 | #if defined(IRAMSIZE) && IRAMSIZE == 0 | 257 | #if defined(IRAMSIZE) && IRAMSIZE == 0 |
259 | *(.idata) | 258 | *(.idata) |
260 | #endif | 259 | #endif |
261 | } > PLUGIN_RAM | 260 | } > PLUGIN_RAM |
262 | 261 | ||
@@ -266,15 +265,11 @@ SECTIONS | |||
266 | . = ALIGN(CACHEALIGN_SIZE); | 265 | . = ALIGN(CACHEALIGN_SIZE); |
267 | *(.ncdata*) | 266 | *(.ncdata*) |
268 | . = ALIGN(CACHEALIGN_SIZE); | 267 | . = ALIGN(CACHEALIGN_SIZE); |
269 | /* EABI currently needs iramcopy defined here, otherwise .iram can sometimes | ||
270 | have an incorrect load address, breaking codecs. */ | ||
271 | #if defined(IRAMSIZE) | ||
272 | iramcopy = . - NOCACHE_BASE; | ||
273 | #endif | ||
274 | } AT> PLUGIN_RAM | 268 | } AT> PLUGIN_RAM |
275 | /* This definition is used when NOCACHE_BASE is 0. The address offset bug only | 269 | . -= NOCACHE_BASE; |
276 | seems to occur when the empty .ncdata is present. */ | 270 | #endif |
277 | #elif defined(IRAMSIZE) | 271 | |
272 | #if defined(IRAMSIZE) && IRAMSIZE != 0 | ||
278 | iramcopy = .; | 273 | iramcopy = .; |
279 | #endif | 274 | #endif |
280 | 275 | ||
@@ -286,33 +281,13 @@ SECTIONS | |||
286 | #endif | 281 | #endif |
287 | } | 282 | } |
288 | 283 | ||
289 | #if defined(IRAMSIZE) && IRAMSIZE != 0 | 284 | .bss . (NOLOAD) : |
290 | .iram IRAMORIG : AT ( iramcopy) | ||
291 | { | ||
292 | iramstart = .; | ||
293 | *(.icode) | ||
294 | *(.irodata) | ||
295 | *(.idata) | ||
296 | iramend = .; | ||
297 | } > PLUGIN_IRAM | ||
298 | |||
299 | |||
300 | .ibss (NOLOAD) : | ||
301 | { | ||
302 | iedata = .; | ||
303 | *(.ibss) | ||
304 | . = ALIGN(0x4); | ||
305 | iend = .; | ||
306 | } > PLUGIN_IRAM | ||
307 | #endif | ||
308 | |||
309 | .bss (NOLOAD) : | ||
310 | { | 285 | { |
311 | plugin_bss_start = .; | 286 | plugin_bss_start = .; |
312 | _plugin_bss_start = .; | 287 | _plugin_bss_start = .; |
313 | *(.bss*) | 288 | *(.bss*) |
314 | #if defined(IRAMSIZE) && IRAMSIZE == 0 | 289 | #if defined(IRAMSIZE) && IRAMSIZE == 0 |
315 | *(.ibss) | 290 | *(.ibss) |
316 | #endif | 291 | #endif |
317 | *(COMMON) | 292 | *(COMMON) |
318 | . = ALIGN(0x4); | 293 | . = ALIGN(0x4); |
@@ -325,15 +300,35 @@ SECTIONS | |||
325 | *(.ncbss*) | 300 | *(.ncbss*) |
326 | . = ALIGN(CACHEALIGN_SIZE); | 301 | . = ALIGN(CACHEALIGN_SIZE); |
327 | } AT> PLUGIN_RAM | 302 | } AT> PLUGIN_RAM |
303 | . -= NOCACHE_BASE; | ||
328 | #endif | 304 | #endif |
329 | 305 | ||
330 | /* Restore . */ | 306 | /* Final end of plugin after IRAM setup */ |
331 | .pluginend . - NOCACHE_BASE : | 307 | .pluginend : |
332 | { | 308 | { |
333 | _plugin_end_addr = .; | 309 | _plugin_end_addr = .; |
334 | plugin_end_addr = .; | 310 | plugin_end_addr = .; |
335 | } | 311 | } |
336 | 312 | ||
313 | #if defined(IRAMSIZE) && IRAMSIZE != 0 | ||
314 | .iram IRAMORIG : AT (iramcopy) | ||
315 | { | ||
316 | iramstart = .; | ||
317 | *(.icode) | ||
318 | *(.irodata) | ||
319 | *(.idata) | ||
320 | iramend = .; | ||
321 | } > PLUGIN_IRAM | ||
322 | |||
323 | .ibss (NOLOAD) : | ||
324 | { | ||
325 | iedata = .; | ||
326 | *(.ibss) | ||
327 | . = ALIGN(0x4); | ||
328 | iend = .; | ||
329 | } > PLUGIN_IRAM | ||
330 | #endif | ||
331 | |||
337 | /* Special trick to avoid a linker error when no other sections are | 332 | /* Special trick to avoid a linker error when no other sections are |
338 | left after garbage collection (plugin not for this platform) */ | 333 | left after garbage collection (plugin not for this platform) */ |
339 | .comment 0 : | 334 | .comment 0 : |