Auto-detect binary in TTS / encoder setting dialog by searching $PATH. Only linux...
[Rockbox.git] / firmware / app.lds
blob8b0bed31d2d4e155c21363c7ec314509f2ced897
1 #include "config.h"
3 ENTRY(start)
4 #ifdef CPU_COLDFIRE
5 OUTPUT_FORMAT(elf32-m68k)
6 INPUT(target/coldfire/crt0.o)
7 #elif defined(CPU_ARM)
8 OUTPUT_FORMAT(elf32-littlearm)
9 OUTPUT_ARCH(arm)
10 #ifdef CPU_PP
11 INPUT(target/arm/crt0-pp.o)
12 #elif CONFIG_CPU == PNX0101
13 INPUT(target/arm/pnx0101/crt0-pnx0101.o)
14 #elif defined(CPU_ARM)
15 INPUT(target/arm/crt0.o)
16 #endif
17 #else
18 OUTPUT_FORMAT(elf32-sh)
19 INPUT(target/sh/crt0.o)
20 #endif
22 #define PLUGINSIZE PLUGIN_BUFFER_SIZE
23 #define CODECSIZE CODEC_SIZE
25 #ifdef DEBUG
26 #define STUBOFFSET 0x10000
27 #else
28 #define STUBOFFSET 0
29 #endif
31 #if CONFIG_CPU!=S3C2440
32 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
33 #endif
34 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
35 #define DRAMORIG 0x31000000 + STUBOFFSET
36 #define IRAMORIG 0x10000000
37 #define IRAMSIZE 0xc000
38 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
39 #define DRAMORIG 0x31000000 + STUBOFFSET
40 #define IRAMORIG 0x10000000
41 #define IRAMSIZE 0x10000
42 #elif defined(CPU_PP)
43 #define DRAMORIG 0x00000000 + STUBOFFSET
44 #define IRAMORIG 0x40000000
45 #define IRAMSIZE 0xc000
46 #elif CONFIG_CPU==PNX0101
47 #define DRAMORIG 0xc00000 + STUBOFFSET
48 #define IRAMORIG 0x400000
49 #define IRAMSIZE 0x7000
50 #elif CONFIG_CPU==S3C2440
51 #include "s3c2440.h"
52 #define DRAMORIG (0x100 + STUBOFFSET)
53 #define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - STUBOFFSET - LCD_BUFFER_SIZE - TTB_SIZE - PLUGINSIZE - CODECSIZE
54 #define IRAMORIG DRAMORIG
55 #define IRAMSIZE 4K
56 #define IRAM DRAM
57 #else
58 #define DRAMORIG 0x09000000 + STUBOFFSET
59 #define IRAMORIG 0x0f000000
60 #define IRAMSIZE 0x1000
61 #endif
63 /* End of the audio buffer, where the codec buffer starts */
64 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
66 /* Where the codec buffer ends, and the plugin buffer starts */
67 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
69 MEMORY
71    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
72 #if CONFIG_CPU != S3C2440
73    IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
74 #endif
75 #if CONFIG_CPU==PNX0101
76    IRAM0 : ORIGIN = 0x0, LENGTH = IRAMSIZE
77 #endif
80 SECTIONS
82 #ifndef CPU_ARM
83     .vectors :
84     {
85         loadaddress = .;
86         _loadaddress = .;
87         KEEP(*(.resetvectors));
88         *(.resetvectors);
89         KEEP(*(.vectors));
90         *(.vectors);
91     } > DRAM
93     .text :
94     {
95 #else
96     .text :
97     {
98         loadaddress = .;
99         _loadaddress = .;
100 #endif
101         . = ALIGN(0x200);
102         *(.init.text)
103         *(.text*)
104 #ifdef CPU_ARM
105         *(.glue_7)
106         *(.glue_7t)
107 #endif
108         . = ALIGN(0x4);
109     } > DRAM
111     .rodata :
112     {
113         *(.rodata)  /* problems without this, dunno why */
114         *(.rodata*)
115         *(.rodata.str1.1)
116         *(.rodata.str1.4)
117         . = ALIGN(0x4);
119         /* Pseudo-allocate the copies of the data sections */
120         _datacopy = .;
121     } > DRAM
123     /* TRICK ALERT! For RAM execution, we put the .data section at the
124        same load address as the copy. Thus, we don't waste extra RAM
125        when we don't actually need the copy.  */
126     .data : AT ( _datacopy )
127     {
128         _datastart = .;
129         *(.data*)
130         . = ALIGN(0x4);
131         _dataend  = .;
132     } > DRAM
134     /DISCARD/ :
135     {
136         *(.eh_frame)
137     }
139 #ifdef CPU_ARM
140     .vectors 0x0 :
141     {
142         _vectorsstart = .;
143         *(.vectors);
144         _vectorsend = .;
145 #if CONFIG_CPU==PNX0101
146         *(.dmabuf)
147     } >IRAM0 AT> DRAM
148 #else
149     } AT> DRAM
150 #endif
152     _vectorscopy = LOADADDR(.vectors);
153 #endif
155 #if CONFIG_CPU==PNX0101
156     .iram IRAMORIG + SIZEOF(.vectors) :
157 #elif CONFIG_CPU==S3C2440
158     .iram :
159 #else
160     .iram IRAMORIG :
161 #endif
162     {
163         _iramstart = .;
164         *(.icode)
165         *(.irodata)
166         *(.idata)
167         _iramend = .;
168     } > IRAM AT> DRAM
170     _iramcopy = LOADADDR(.iram);
172     .ibss (NOLOAD) :
173     {
174         _iedata = .;
175         *(.ibss)
176         . = ALIGN(0x4);
177         _iend = .;
178     } > IRAM
180 #if defined(CPU_COLDFIRE) || defined(CPU_ARM)
181     .stack :
182     {
183        *(.stack)
184        stackbegin = .;
185        . += 0x2000;
186        stackend = .;
187     } > IRAM
189 #ifdef CPU_PP
190     .cop_stack :
191     {
192        *(.cop_stack)
193        cop_stackbegin = .;
194        . += 0x0500;
195        cop_stackend = .;
196     } > IRAM
197 #endif
199 #else
200     /* TRICK ALERT! We want 0x2000 bytes of stack, but we set the section
201        size smaller, and allow the stack to grow into the .iram copy */
202     .stack ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
203     {
204        *(.stack)
205        _stackbegin = . - SIZEOF(.iram);
206        . += 0x2000 - SIZEOF(.iram);
207        _stackend = .;
208     } > DRAM
209 #endif
211 #if defined(CPU_COLDFIRE)
212     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
213 #elif defined(CPU_ARM) && CONFIG_CPU != S3C2440
214     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram) + SIZEOF(.vectors):
215 #else
216     .bss :
217 #endif
218     {
219        _edata = .;
220         *(.bss*)
221         *(COMMON)
222         . = ALIGN(0x4);
223        _end = .;
224     } > DRAM
226     .audiobuf ALIGN(4) :
227     {
228         _audiobuffer = .;
229         audiobuffer = .;
230     } > DRAM
232     .audiobufend ENDAUDIOADDR:
233     {
234         audiobufend = .;
235         _audiobufend = .;
236     } > DRAM
238     .codec ENDAUDIOADDR:
239     {
240         codecbuf = .;
241         _codecbuf = .;
242     }
244     .plugin ENDADDR:
245     {
246         _pluginbuf = .;
247         pluginbuf = .;
248     }