summaryrefslogtreecommitdiff
path: root/apps/plugins/plugin.lds
diff options
context:
space:
mode:
authorMichael Sevakis <jethead71@rockbox.org>2013-07-10 22:30:50 -0400
committerMichael Sevakis <jethead71@rockbox.org>2013-07-10 22:37:17 -0400
commit5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f (patch)
tree2ecea9b02401dc188ca8e67bbad614e29956db0e /apps/plugins/plugin.lds
parent18f9486e3bdaaa506e24b3e1db09e970946abbdc (diff)
downloadrockbox-5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f.zip
rockbox-5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f.tar.gz
rockbox-5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f.tar.bz2
rockbox-5c2ad2fd36be7a0d1ec2468e6b270047c36d8a6f.tar.xz
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/plugins/plugin.lds')
-rw-r--r--apps/plugins/plugin.lds65
1 files changed, 30 insertions, 35 deletions
diff --git a/apps/plugins/plugin.lds b/apps/plugins/plugin.lds
index 10ce98f..d5cfaae 100644
--- a/apps/plugins/plugin.lds
+++ b/apps/plugins/plugin.lds
@@ -247,16 +247,15 @@ SECTIONS
{
*(.rodata*)
#if defined(IRAMSIZE) && IRAMSIZE == 0
- *(.irodata)
+ *(.irodata)
#endif
- . = ALIGN(0x4);
} > PLUGIN_RAM
.data :
{
*(.data*)
#if defined(IRAMSIZE) && IRAMSIZE == 0
- *(.idata)
+ *(.idata)
#endif
} > PLUGIN_RAM
@@ -266,15 +265,11 @@ SECTIONS
. = ALIGN(CACHEALIGN_SIZE);
*(.ncdata*)
. = ALIGN(CACHEALIGN_SIZE);
-/* EABI currently needs iramcopy defined here, otherwise .iram can sometimes
- have an incorrect load address, breaking codecs. */
-#if defined(IRAMSIZE)
- iramcopy = . - NOCACHE_BASE;
-#endif
} AT> PLUGIN_RAM
-/* This definition is used when NOCACHE_BASE is 0. The address offset bug only
- seems to occur when the empty .ncdata is present. */
-#elif defined(IRAMSIZE)
+ . -= NOCACHE_BASE;
+#endif
+
+#if defined(IRAMSIZE) && IRAMSIZE != 0
iramcopy = .;
#endif
@@ -286,33 +281,13 @@ SECTIONS
#endif
}
-#if defined(IRAMSIZE) && IRAMSIZE != 0
- .iram IRAMORIG : AT ( iramcopy)
- {
- iramstart = .;
- *(.icode)
- *(.irodata)
- *(.idata)
- iramend = .;
- } > PLUGIN_IRAM
-
-
- .ibss (NOLOAD) :
- {
- iedata = .;
- *(.ibss)
- . = ALIGN(0x4);
- iend = .;
- } > PLUGIN_IRAM
-#endif
-
- .bss (NOLOAD) :
+ .bss . (NOLOAD) :
{
plugin_bss_start = .;
_plugin_bss_start = .;
*(.bss*)
#if defined(IRAMSIZE) && IRAMSIZE == 0
- *(.ibss)
+ *(.ibss)
#endif
*(COMMON)
. = ALIGN(0x4);
@@ -325,15 +300,35 @@ SECTIONS
*(.ncbss*)
. = ALIGN(CACHEALIGN_SIZE);
} AT> PLUGIN_RAM
+ . -= NOCACHE_BASE;
#endif
- /* Restore . */
- .pluginend . - NOCACHE_BASE :
+ /* Final end of plugin after IRAM setup */
+ .pluginend :
{
_plugin_end_addr = .;
plugin_end_addr = .;
}
+#if defined(IRAMSIZE) && IRAMSIZE != 0
+ .iram IRAMORIG : AT (iramcopy)
+ {
+ iramstart = .;
+ *(.icode)
+ *(.irodata)
+ *(.idata)
+ iramend = .;
+ } > PLUGIN_IRAM
+
+ .ibss (NOLOAD) :
+ {
+ iedata = .;
+ *(.ibss)
+ . = ALIGN(0x4);
+ iend = .;
+ } > PLUGIN_IRAM
+#endif
+
/* Special trick to avoid a linker error when no other sections are
left after garbage collection (plugin not for this platform) */
.comment 0 :