summaryrefslogtreecommitdiffstats
path: root/firmware/target/mips/ingenic_jz47xx/app.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/mips/ingenic_jz47xx/app.lds')
-rw-r--r--firmware/target/mips/ingenic_jz47xx/app.lds20
1 files changed, 20 insertions, 0 deletions
diff --git a/firmware/target/mips/ingenic_jz47xx/app.lds b/firmware/target/mips/ingenic_jz47xx/app.lds
index cbeb7c1aaf..1d300fed82 100644
--- a/firmware/target/mips/ingenic_jz47xx/app.lds
+++ b/firmware/target/mips/ingenic_jz47xx/app.lds
@@ -1,4 +1,6 @@
#include "config.h"
+#define __ASSEMBLY__
+#include "cpu.h"
OUTPUT_FORMAT("elf32-littlemips")
OUTPUT_ARCH(MIPS)
@@ -20,10 +22,15 @@ INPUT(target/mips/system-mips.o)
/* Where the codec buffer ends, and the plugin buffer starts */
#define ENDCODECADDR (ENDAUDIOADDR + CODEC_SIZE)
+/* Place init code in the codec buffer */
+#define INITBASE ENDAUDIOADDR
+#define INITSIZE CODEC_SIZE
+
MEMORY
{
DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
+ INIT : ORIGIN = INITBASE, LENGTH = INITSIZE
}
SECTIONS
@@ -40,6 +47,9 @@ SECTIONS
.text :
{
*(.text*);
+#ifndef HAVE_INIT_ATTR
+ *(.init*);
+#endif
} > DRAM
. = ALIGN(4);
@@ -81,6 +91,16 @@ SECTIONS
} > IRAM
_iramcopy = LOADADDR(.iram);
+#ifdef HAVE_INIT_ATTR
+ .init :
+ {
+ _initstart = .;
+ *(.init*);
+ _initend = .;
+ } > INIT AT> DRAM
+ _initcopy = LOADADDR(.init);
+#endif
+
. = ALIGN(4);
.stack (NOLOAD):