Make TTS name conversion functions static members.
[Rockbox.git] / firmware / app.lds
blobd2a9582a3ddb2f3f0e1bf5b61a19988e8f512a8d
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==DM320
13 INPUT(target/arm/tms320dm320/crt0.o)
14 #elif CONFIG_CPU==S3C2440
15 INPUT(target/arm/s3c2440/crt0.o)
16 #elif defined(CPU_TCC780X)
17 INPUT(target/arm/tcc780x/crt0.o)
18 #elif CONFIG_CPU == PNX0101
19 INPUT(target/arm/pnx0101/crt0-pnx0101.o)
20 #elif CONFIG_CPU == IMX31L
21 INPUT(target/arm/imx31/crt0.o)
22 #elif defined(CPU_ARM)
23 INPUT(target/arm/crt0.o)
24 #endif
25 #else
26 OUTPUT_FORMAT(elf32-sh)
27 INPUT(target/sh/crt0.o)
28 #endif
30 #define PLUGINSIZE PLUGIN_BUFFER_SIZE
31 #define CODECSIZE CODEC_SIZE
33 #ifdef DEBUG
34 #define STUBOFFSET 0x10000
35 #else
36 #define STUBOFFSET 0
37 #endif
39 #if CONFIG_CPU==S3C2440
40 #include "s3c2440.h"
41 #define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGINSIZE - STUBOFFSET - CODECSIZE - LCD_BUFFER_SIZE - TTB_SIZE
42 #elif CONFIG_CPU==IMX31L
43 #include "imx31l.h"
44 /* Subtract 1MB for the FRAME/TTB section */
45 #define DRAMSIZE (MEMORYSIZE * 0x100000 - 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
46 #elif CONFIG_CPU==DM320
47 #include "dm320.h"
48 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE - LCD_BUFFER_SIZE - TTB_SIZE
49 #else
50 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
51 #endif
53 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
54 #define DRAMORIG 0x31000000 + STUBOFFSET
55 #define IRAMORIG 0x10000000
56 #define IRAMSIZE 0xc000
57 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
58 #define DRAMORIG 0x31000000 + STUBOFFSET
59 #define IRAMORIG 0x10000000
60 #define IRAMSIZE 0x10000
61 #elif defined(CPU_PP)
62 #define DRAMORIG 0x00000000 + STUBOFFSET
63 #define IRAMORIG 0x40000000
64 #define IRAMSIZE 0xc000
65 #elif CONFIG_CPU==PNX0101
66 #define DRAMORIG 0xc00000 + STUBOFFSET
67 #define IRAM0ORIG 0x000000
68 #define IRAM0SIZE 0x7000
69 #define IRAMORIG 0x400000
70 #define IRAMSIZE 0x7000
71 #elif CONFIG_CPU==S3C2440
72 #define DRAMORIG 0x00000100 + STUBOFFSET
73 #define IRAMORIG DRAMORIG
74 #define IRAM DRAM
75 #define IRAMSIZE 0x1000
76 #elif CONFIG_CPU==DM320
77 #define DRAMORIG 0x00900000 + STUBOFFSET
78 #define IRAMORIG 0x00000000
79 #define IRAMSIZE 0x4000
80 #elif CONFIG_CPU==IMX31L
81 #define DRAMORIG (0x0 + STUBOFFSET)
82 /* #define IRAMORIG 0x1FFFC000 */
83 #define IRAMORIG DRAMORIG
84 #define IRAM     DRAM
85 #define IRAMSIZE 0x4000
86 #elif defined(CPU_TCC780X)
87 #define DRAMORIG 0x20000000 + STUBOFFSET
88 #define ITCMORIG 0x00000000
89 #define ITCMSIZE 0x1000
90 #define DTCMORIG 0xA0000000
91 #define DTCMSIZE 0x2000
92 #define SRAMORIG 0x10000000
93 #define SRAMSIZE 0xc000
94 #else
95 #define DRAMORIG 0x09000000 + STUBOFFSET
96 #define IRAMORIG 0x0f000000
97 #define IRAMSIZE 0x1000
98 #endif
100 /* End of the audio buffer, where the codec buffer starts */
101 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
103 /* Where the codec buffer ends, and the plugin buffer starts */
104 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
106 MEMORY
108     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
109 #if defined(CPU_TCC780X)
110     /* Seperate data & instruction TCMs plus SRAM. */
111     ITCM : ORIGIN = ITCMORIG, LENGTH = ITCMSIZE
112     DTCM : ORIGIN = DTCMORIG, LENGTH = DTCMSIZE
113     SRAM : ORIGIN = SRAMORIG, LENGTH = SRAMSIZE
114 #elif CONFIG_CPU != S3C2440 && CONFIG_CPU != IMX31L
115     IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
116 #endif
117 #if CONFIG_CPU==PNX0101
118     IRAM0 : ORIGIN = IRAM0ORIG, LENGTH = IRAM0SIZE
119 #endif
122 SECTIONS
124 #if (CONFIG_CPU==DM320)
125     .text :
126     {
127         loadaddress = .;
128         _loadaddress = .;
129         . = ALIGN(0x200);
130         *(.init.text)
131         *(.text*)
132         *(.glue_7)
133         *(.glue_7t)
134         . = ALIGN(0x4);
135     } > DRAM
137     .rodata :
138     {
139         *(.rodata)  /* problems without this, dunno why */
140         *(.rodata*)
141         *(.rodata.str1.1)
142         *(.rodata.str1.4)
143         . = ALIGN(0x4);
145         /* Pseudo-allocate the copies of the data sections */
146         _datacopy = .;
147     } > DRAM
149     /* TRICK ALERT! For RAM execution, we put the .data section at the
150        same load address as the copy. Thus, we don't waste extra RAM
151        when we don't actually need the copy.  */
152     .data : AT ( _datacopy )
153     {
154         _datastart = .;
155         *(.data*)
156         . = ALIGN(0x4);
157         _dataend  = .;
158     } > DRAM
160     /DISCARD/ :
161     {
162         *(.eh_frame)
163     }
165     .vectors IRAMORIG :
166     {
167         _vectorsstart = .;
168         *(.vectors);
169         _vectorsend = .;
170     } > IRAM AT> DRAM
172     _vectorscopy = LOADADDR(.vectors);
174     .iram :
175     {
176         _iramstart = .;
177         *(.icode)
178         *(.irodata)
179         *(.idata)
180         . = ALIGN(0x4);        
181         _iramend = .;
182     } > IRAM AT> DRAM
184     _iramcopy = LOADADDR(.iram);
186     .ibss (NOLOAD) :
187     {
188         _iedata = .;
189         *(.ibss)
190         . = ALIGN(0x4);
191         _iend = .;
192     } > IRAM
194     .stack :
195     {
196        *(.stack)
197        stackbegin = .;
198        . += 0x2000;
199        stackend = .;
200     } > IRAM
202     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram) + SIZEOF(.vectors):
203     {
204        _edata = .;
205         *(.bss*)
206         *(COMMON)
207         . = ALIGN(0x4);
208        _end = .;
209     } > DRAM
211 #elif defined(CPU_TCC780X)
212     .text :
213     {
214         loadaddress = .;
215         _loadaddress = .;
216         . = ALIGN(0x200);
217         *(.init.text)
218         *(.text*)
219         *(.glue_7)
220         *(.glue_7t)
221         . = ALIGN(0x4);
222     } > DRAM
224     .rodata :
225     {
226         *(.rodata)  /* problems without this, dunno why */
227         *(.rodata*)
228         *(.rodata.str1.1)
229         *(.rodata.str1.4)
230         . = ALIGN(0x4);
232         /* Pseudo-allocate the copies of the data sections */
233         _datacopy = .;
234     } > DRAM
236     /* TRICK ALERT! For RAM execution, we put the .data section at the
237        same load address as the copy. Thus, we don't waste extra RAM
238        when we don't actually need the copy.  */
239     .data : AT ( _datacopy )
240     {
241         _datastart = .;
242         *(.data*)
243         . = ALIGN(0x4);
244         _dataend  = .;
245     } > DRAM
247     /DISCARD/ :
248     {
249         *(.eh_frame)
250     }
252     .vectors ITCMORIG :
253     {
254         _vectorsstart = .;
255         *(.vectors);
256         _vectorsend = .;
257     } > ITCM AT> DRAM
259     _vectorscopy = LOADADDR(.vectors);
261     .itcm :
262     {
263         _itcmstart = .;
264         *(.icode)
265         _itcmend = .;
266     } > ITCM AT> DRAM
268     _itcmcopy = LOADADDR(.itcm);
269     
270     .dtcm :
271     {
272         _dtcmstart = .;
273         *(.irodata)
274         *(.idata)
275         _dtcmend = .;
276     } > DTCM AT> DRAM
278     _dtcmcopy = LOADADDR(.dtcm);
280     .ibss (NOLOAD) :
281     {
282         _iedata = .;
283         *(.ibss)
284         . = ALIGN(0x4);
285         _iend = .;
286     } > SRAM
288     .stack :
289     {
290        *(.stack)
291        stackbegin = .;
292        . += 0x2000;
293        stackend = .;
294     } > SRAM
296     .bss :
297     {
298        _edata = .;
299         *(.bss*)
300         *(COMMON)
301         . = ALIGN(0x4);
302        _end = .;
303     } > DRAM
305 #elif CONFIG_CPU==S3C2440 || CONFIG_CPU == IMX31L
306     .text :
307     {
308         loadaddress = .;
309         _loadaddress = .;
310         . = ALIGN(0x200);
311         *(.init.text)
312         *(.text*)
313         *(.glue_7)
314         *(.glue_7t)
315         . = ALIGN(0x4);
316     } > DRAM
318     .rodata :
319     {
320         *(.rodata)  /* problems without this, dunno why */
321         *(.rodata*)
322         *(.rodata.str1.1)
323         *(.rodata.str1.4)
324         . = ALIGN(0x4);
326         /* Pseudo-allocate the copies of the data sections */
327         _datacopy = .;
328     } > DRAM
330     /* TRICK ALERT! For RAM execution, we put the .data section at the
331        same load address as the copy. Thus, we don't waste extra RAM
332        when we don't actually need the copy.  */
333     .data : AT ( _datacopy )
334     {
335         _datastart = .;
336         *(.data*)
337         . = ALIGN(0x4);
338         _dataend  = .;
339     } > DRAM
341     /DISCARD/ :
342     {
343         *(.eh_frame)
344     }
346     .vectors 0x0 :
347     {
348         _vectorsstart = .;
349         *(.vectors);
350         _vectorsend = .;
351     } AT> DRAM
353     _vectorscopy = LOADADDR(.vectors);
355     .iram :
356     {
357         _iramstart = .;
358         *(.icode)
359         *(.irodata)
360         *(.idata)
361         _iramend = .;
362     } > DRAM
364     _iramcopy = LOADADDR(.iram);
366     .ibss (NOLOAD) :
367     {
368         _iedata = .;
369         *(.ibss)
370         . = ALIGN(0x4);
371         _iend = .;
372     } > DRAM
374     .stack :
375     {
376        *(.stack)
377        stackbegin = .;
378        . += 0x2000;
379        stackend = .;
380     } > DRAM
382     .bss :
383     {
384        _edata = .;
385         *(.bss*)
386         *(COMMON)
387         . = ALIGN(0x4);
388        _end = .;
389     } > DRAM
391 #else /* End CONFIG_CPU */
393 #if !defined(CPU_ARM)
394     .vectors :
395     {
396         loadaddress = .;
397         _loadaddress = .;
398         KEEP(*(.resetvectors));
399         *(.resetvectors);
400         KEEP(*(.vectors));
401         *(.vectors);
402     } > DRAM
404     .text :
405     {
406 #else
407     .text :
408     {
409         loadaddress = .;
410         _loadaddress = .;
411 #endif
412         . = ALIGN(0x200);
413         *(.init.text)
414         *(.text*)
415 #ifdef CPU_ARM
416         *(.glue_7)
417         *(.glue_7t)
418 #endif
419         . = ALIGN(0x4);
420     } > DRAM
422     .rodata :
423     {
424         *(.rodata)  /* problems without this, dunno why */
425         *(.rodata*)
426         *(.rodata.str1.1)
427         *(.rodata.str1.4)
428         . = ALIGN(0x4);
430         /* Pseudo-allocate the copies of the data sections */
431         _datacopy = .;
432     } > DRAM
434     /* TRICK ALERT! For RAM execution, we put the .data section at the
435        same load address as the copy. Thus, we don't waste extra RAM
436        when we don't actually need the copy.  */
437     .data : AT ( _datacopy )
438     {
439         _datastart = .;
440         *(.data*)
441         . = ALIGN(0x4);
442         _dataend  = .;
443     } > DRAM
445     /DISCARD/ :
446     {
447         *(.eh_frame)
448     }
450 #if defined(CPU_ARM)
451     .vectors 0x0 :
452     {
453         _vectorsstart = .;
454         *(.vectors);
455         _vectorsend = .;
456 #if CONFIG_CPU==PNX0101
457         *(.dmabuf)
458     } >IRAM0 AT> DRAM
459 #else
460     } AT> DRAM
461 #endif
463     _vectorscopy = LOADADDR(.vectors);
464 #endif
466 #if CONFIG_CPU==PNX0101
467     .iram IRAMORIG + SIZEOF(.vectors) :
468 #else
469     .iram IRAMORIG :
470 #endif
471     {
472         _iramstart = .;
473         *(.icode)
474         *(.irodata)
475         *(.idata)
476         _iramend = .;
477     } > IRAM AT> DRAM
479     _iramcopy = LOADADDR(.iram);
481     .ibss (NOLOAD) :
482     {
483         _iedata = .;
484         *(.ibss)
485         . = ALIGN(0x4);
486         _iend = .;
487     } > IRAM
489 #if defined(CPU_COLDFIRE) || defined(CPU_ARM)
490 #ifdef CPU_PP
491     .idle_stacks :
492     {
493        *(.idle_stacks)
494 #if NUM_CORES > 1
495        cpu_idlestackbegin = .;
496        . += IDLE_STACK_SIZE;
497        cpu_idlestackend = .;
498 #endif
499        cop_idlestackbegin = .;
500        . += IDLE_STACK_SIZE;
501        cop_idlestackend = .;
502     } > IRAM
503 #endif
505     .stack :
506     {
507        *(.stack)
508        stackbegin = .;
509        . += 0x2000;
510        stackend = .;
511     } > IRAM
513 #else
514     /* TRICK ALERT! We want 0x2000 bytes of stack, but we set the section
515        size smaller, and allow the stack to grow into the .iram copy */
516     .stack ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
517     {
518        *(.stack)
519        _stackbegin = . - SIZEOF(.iram);
520        . += 0x2000 - SIZEOF(.iram);
521        _stackend = .;
522     } > DRAM
523 #endif
525 #if defined(CPU_COLDFIRE)
526     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
527 #elif defined(CPU_ARM)
528     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram) + SIZEOF(.vectors):
529 #else
530     .bss :
531 #endif
532     {
533        _edata = .;
534         *(.bss*)
535         *(COMMON)
536         . = ALIGN(0x4);
537        _end = .;
538     } > DRAM
539     
540 #endif
542     .audiobuf ALIGN(4) :
543     {
544         _audiobuffer = .;
545         audiobuffer = .;
546     } > DRAM
548     .audiobufend ENDAUDIOADDR:
549     {
550         audiobufend = .;
551         _audiobufend = .;
552     } > DRAM
554     .codec ENDAUDIOADDR:
555     {
556         codecbuf = .;
557         _codecbuf = .;
558     }
560     .plugin ENDADDR:
561     {
562         _pluginbuf = .;
563         pluginbuf = .;
564     }