Add some screenshots for Sansa c200.
[Rockbox.git] / firmware / app.lds
blob6c67a96481b3119277020b9cec3a5f348cf2f785
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 #include "s3c2440.h"
33 #define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGINSIZE - STUBOFFSET - CODECSIZE - LCD_BUFFER_SIZE - TTB_SIZE
34 #else
35 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
36 #endif
38 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
39 #define DRAMORIG 0x31000000 + STUBOFFSET
40 #define IRAMORIG 0x10000000
41 #define IRAMSIZE 0xc000
42 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
43 #define DRAMORIG 0x31000000 + STUBOFFSET
44 #define IRAMORIG 0x10000000
45 #define IRAMSIZE 0x10000
46 #elif defined(CPU_PP)
47 #define DRAMORIG 0x00000000 + STUBOFFSET
48 #define IRAMORIG 0x40000000
49 #define IRAMSIZE 0xc000
50 #elif CONFIG_CPU==PNX0101
51 #define DRAMORIG 0xc00000 + STUBOFFSET
52 #define IRAMORIG 0x400000
53 #define IRAMSIZE 0x7000
54 #elif CONFIG_CPU==S3C2440
55 #define DRAMORIG 0x00000100 + STUBOFFSET
56 #define IRAMORIG DRAMORIG
57 #define IRAMSIZE 0x1000
58 #define IRAM DRAM
59 #elif CONFIG_CPU==DM320
60 #define DRAMORIG 0x00900000 + STUBOFFSET
61 #define IRAMORIG 0x00000000
62 #define IRAMSIZE 0x4000
63 #elif CONFIG_CPU==IMX31L
64 #define DRAMORIG (0x80000000 + STUBOFFSET)
65 #define IRAMORIG 0x1FFFC000
66 #define IRAMSIZE 0x4000
67 #else
68 #define DRAMORIG 0x09000000 + STUBOFFSET
69 #define IRAMORIG 0x0f000000
70 #define IRAMSIZE 0x1000
71 #endif
73 /* End of the audio buffer, where the codec buffer starts */
74 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
76 /* Where the codec buffer ends, and the plugin buffer starts */
77 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
79 MEMORY
81    DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
82 #if CONFIG_CPU != S3C2440
83    IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
84 #endif
85 #if CONFIG_CPU==PNX0101
86    IRAM0 : ORIGIN = 0x0, LENGTH = IRAMSIZE
87 #endif
90 SECTIONS
92 #if !defined(CPU_ARM)
93     .vectors :
94     {
95         loadaddress = .;
96         _loadaddress = .;
97         KEEP(*(.resetvectors));
98         *(.resetvectors);
99         KEEP(*(.vectors));
100         *(.vectors);
101     } > DRAM
103     .text :
104     {
105 #else
106     .text :
107     {
108         loadaddress = .;
109         _loadaddress = .;
110 #endif
111         . = ALIGN(0x200);
112         *(.init.text)
113         *(.text*)
114 #ifdef CPU_ARM
115         *(.glue_7)
116         *(.glue_7t)
117 #endif
118         . = ALIGN(0x4);
119     } > DRAM
121     .rodata :
122     {
123         *(.rodata)  /* problems without this, dunno why */
124         *(.rodata*)
125         *(.rodata.str1.1)
126         *(.rodata.str1.4)
127         . = ALIGN(0x4);
129         /* Pseudo-allocate the copies of the data sections */
130         _datacopy = .;
131     } > DRAM
133     /* TRICK ALERT! For RAM execution, we put the .data section at the
134        same load address as the copy. Thus, we don't waste extra RAM
135        when we don't actually need the copy.  */
136     .data : AT ( _datacopy )
137     {
138         _datastart = .;
139         *(.data*)
140         . = ALIGN(0x4);
141         _dataend  = .;
142     } > DRAM
144     /DISCARD/ :
145     {
146         *(.eh_frame)
147     }
149 #if defined(CPU_ARM)
150     .vectors 0x0 :
151     {
152         _vectorsstart = .;
153         *(.vectors);
154         _vectorsend = .;
155 #if CONFIG_CPU==PNX0101
156         *(.dmabuf)
157     } >IRAM0 AT> DRAM
158 #else
159     } AT> DRAM
160 #endif
162     _vectorscopy = LOADADDR(.vectors);
163 #endif
165 #if CONFIG_CPU==PNX0101
166     .iram IRAMORIG + SIZEOF(.vectors) :
167 #elif CONFIG_CPU==S3C2440
168     .iram :
169 #else
170     .iram IRAMORIG :
171 #endif
172     {
173         _iramstart = .;
174         *(.icode)
175         *(.irodata)
176         *(.idata)
177         _iramend = .;
178     } > IRAM AT> DRAM
180     _iramcopy = LOADADDR(.iram);
182     .ibss (NOLOAD) :
183     {
184         _iedata = .;
185         *(.ibss)
186         . = ALIGN(0x4);
187         _iend = .;
188     } > IRAM
190 #if defined(CPU_COLDFIRE) || defined(CPU_ARM)
191     .stack :
192     {
193        *(.stack)
194        stackbegin = .;
195        . += 0x2000;
196        stackend = .;
197     } > IRAM
199 #ifdef CPU_PP
200     .cop_stack :
201     {
202        *(.cop_stack)
203        cop_stackbegin = .;
204        . += 0x0500;
205        cop_stackend = .;
206     } > IRAM
207 #endif
209 #else
210     /* TRICK ALERT! We want 0x2000 bytes of stack, but we set the section
211        size smaller, and allow the stack to grow into the .iram copy */
212     .stack ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
213     {
214        *(.stack)
215        _stackbegin = . - SIZEOF(.iram);
216        . += 0x2000 - SIZEOF(.iram);
217        _stackend = .;
218     } > DRAM
219 #endif
221 #if defined(CPU_COLDFIRE)
222     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram):
223 #elif defined(CPU_ARM) && CONFIG_CPU != S3C2440
224     .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram) + SIZEOF(.vectors):
225 #else
226     .bss :
227 #endif
228     {
229        _edata = .;
230         *(.bss*)
231         *(COMMON)
232         . = ALIGN(0x4);
233        _end = .;
234     } > DRAM
236     .audiobuf ALIGN(4) :
237     {
238         _audiobuffer = .;
239         audiobuffer = .;
240     } > DRAM
242     .audiobufend ENDAUDIOADDR:
243     {
244         audiobufend = .;
245         _audiobufend = .;
246     } > DRAM
248     .codec ENDAUDIOADDR:
249     {
250         codecbuf = .;
251         _codecbuf = .;
252     }
254     .plugin ENDADDR:
255     {
256         _pluginbuf = .;
257         pluginbuf = .;
258     }