summaryrefslogtreecommitdiff
path: root/firmware/target/arm/imx31/app.lds
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/target/arm/imx31/app.lds')
-rw-r--r--firmware/target/arm/imx31/app.lds150
1 files changed, 150 insertions, 0 deletions
diff --git a/firmware/target/arm/imx31/app.lds b/firmware/target/arm/imx31/app.lds
new file mode 100644
index 0000000000..fda508dc50
--- /dev/null
+++ b/firmware/target/arm/imx31/app.lds
@@ -0,0 +1,150 @@
1#include "config.h"
2
3ENTRY(start)
4
5OUTPUT_FORMAT(elf32-littlearm)
6OUTPUT_ARCH(arm)
7INPUT(target/arm/imx31/crt0.o)
8
9#define PLUGINSIZE PLUGIN_BUFFER_SIZE
10#define CODECSIZE CODEC_SIZE
11
12#ifdef DEBUG
13#define STUBOFFSET 0x10000
14#else
15#define STUBOFFSET 0
16#endif
17
18#include "imx31l.h"
19/* Subtract 1MB for the FRAME/TTB section */
20#define DRAMSIZE (MEMORYSIZE * 0x100000 - 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
21
22#define DRAMORIG (0x0 + STUBOFFSET)
23/* #define IRAMORIG 0x1FFFC000 */
24#define IRAMORIG DRAMORIG
25#define IRAM DRAM
26#define IRAMSIZE 0x4000
27
28/* End of the audio buffer, where the codec buffer starts */
29#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
30
31/* Where the codec buffer ends, and the plugin buffer starts */
32#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
33
34MEMORY
35{
36 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
37}
38
39SECTIONS
40{
41 .text :
42 {
43 loadaddress = .;
44 _loadaddress = .;
45 . = ALIGN(0x200);
46 *(.init.text)
47 *(.text*)
48 *(.glue_7)
49 *(.glue_7t)
50 . = ALIGN(0x4);
51 } > DRAM
52
53 .rodata :
54 {
55 *(.rodata) /* problems without this, dunno why */
56 *(.rodata*)
57 *(.rodata.str1.1)
58 *(.rodata.str1.4)
59 . = ALIGN(0x4);
60
61 /* Pseudo-allocate the copies of the data sections */
62 _datacopy = .;
63 } > DRAM
64
65 /* TRICK ALERT! For RAM execution, we put the .data section at the
66 same load address as the copy. Thus, we don't waste extra RAM
67 when we don't actually need the copy. */
68 .data : AT ( _datacopy )
69 {
70 _datastart = .;
71 *(.data*)
72 . = ALIGN(0x4);
73 _dataend = .;
74 } > DRAM
75
76 /DISCARD/ :
77 {
78 *(.eh_frame)
79 }
80
81 .vectors 0x0 :
82 {
83 _vectorsstart = .;
84 *(.vectors);
85 _vectorsend = .;
86 } AT> DRAM
87
88 _vectorscopy = LOADADDR(.vectors);
89
90 .iram :
91 {
92 _iramstart = .;
93 *(.icode)
94 *(.irodata)
95 *(.idata)
96 _iramend = .;
97 } > DRAM
98
99 _iramcopy = LOADADDR(.iram);
100
101 .ibss (NOLOAD) :
102 {
103 _iedata = .;
104 *(.ibss)
105 . = ALIGN(0x4);
106 _iend = .;
107 } > DRAM
108
109 .stack :
110 {
111 *(.stack)
112 stackbegin = .;
113 . += 0x2000;
114 stackend = .;
115 } > DRAM
116
117 .bss :
118 {
119 _edata = .;
120 *(.bss*)
121 *(COMMON)
122 . = ALIGN(0x4);
123 _end = .;
124 } > DRAM
125
126 .audiobuf ALIGN(4) :
127 {
128 _audiobuffer = .;
129 audiobuffer = .;
130 } > DRAM
131
132 .audiobufend ENDAUDIOADDR:
133 {
134 audiobufend = .;
135 _audiobufend = .;
136 } > DRAM
137
138 .codec ENDAUDIOADDR:
139 {
140 codecbuf = .;
141 _codecbuf = .;
142 }
143
144 .plugin ENDADDR:
145 {
146 _pluginbuf = .;
147 pluginbuf = .;
148 }
149}
150