Split up app.lds to the respective target directories. The portalplayer devices...
[kugel-rb.git] / firmware / target / arm / tcc780x / app.lds
blob069dd24b9c9b91098fe1273c1d16c311b8c7a8cd
1 #include "config.h"
3 ENTRY(start)
5 OUTPUT_FORMAT(elf32-littlearm)
6 OUTPUT_ARCH(arm)
7 INPUT(target/arm/tcc780x/crt0.o)
9 #define PLUGINSIZE PLUGIN_BUFFER_SIZE
10 #define CODECSIZE CODEC_SIZE
12 #ifdef DEBUG
13 #define STUBOFFSET 0x10000
14 #else
15 #define STUBOFFSET 0
16 #endif
18 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
20 #define DRAMORIG 0x20000000 + STUBOFFSET
21 #define ITCMORIG 0x00000000
22 #define ITCMSIZE 0x1000
23 #define DTCMORIG 0xA0000000
24 #define DTCMSIZE 0x2000
25 #define SRAMORIG 0x10000000
26 #define SRAMSIZE 0xc000
28 /* End of the audio buffer, where the codec buffer starts */
29 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
31 /* Where the codec buffer ends, and the plugin buffer starts */
32 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
34 MEMORY
36     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
37     /* Seperate data & instruction TCMs plus SRAM. */
38     ITCM : ORIGIN = ITCMORIG, LENGTH = ITCMSIZE
39     DTCM : ORIGIN = DTCMORIG, LENGTH = DTCMSIZE
40     SRAM : ORIGIN = SRAMORIG, LENGTH = SRAMSIZE
43 SECTIONS
45     .text :
46     {
47         loadaddress = .;
48         _loadaddress = .;
49         . = ALIGN(0x200);
50         *(.init.text)
51         *(.text*)
52         *(.glue_7)
53         *(.glue_7t)
54         . = ALIGN(0x4);
55     } > DRAM
57     .rodata :
58     {
59         *(.rodata)  /* problems without this, dunno why */
60         *(.rodata*)
61         *(.rodata.str1.1)
62         *(.rodata.str1.4)
63         . = ALIGN(0x4);
65         /* Pseudo-allocate the copies of the data sections */
66         _datacopy = .;
67     } > DRAM
69     /* TRICK ALERT! For RAM execution, we put the .data section at the
70        same load address as the copy. Thus, we don't waste extra RAM
71        when we don't actually need the copy.  */
72     .data : AT ( _datacopy )
73     {
74         _datastart = .;
75         *(.data*)
76         . = ALIGN(0x4);
77         _dataend  = .;
78     } > DRAM
80     /DISCARD/ :
81     {
82         *(.eh_frame)
83     }
85     .vectors ITCMORIG :
86     {
87         _vectorsstart = .;
88         *(.vectors);
89         _vectorsend = .;
90     } > ITCM AT> DRAM
92     _vectorscopy = LOADADDR(.vectors);
94     .itcm :
95     {
96         _itcmstart = .;
97         _itcmend = .;
98     } > ITCM AT> DRAM
100     _itcmcopy = LOADADDR(.itcm);
101     
102     .dtcm :
103     {
104         _dtcmstart = .;
105         _dtcmend = .;
106     } > DTCM AT> DRAM
108     _dtcmcopy = LOADADDR(.dtcm);
110     .iram :
111     {
112         _iramstart = .;
113         *(.irodata)
114         *(.idata)
115         *(.icode)
116         . = ALIGN(0x4);
117         _iramend = .;
118     } > SRAM AT> DRAM
120     _iramcopy = LOADADDR(.iram);
121     
122     .ibss (NOLOAD) :
123     {
124         _iedata = .;
125         *(.ibss)
126         . = ALIGN(0x4);
127         _iend = .;
128     } > SRAM
130     .stack :
131     {
132        *(.stack)
133        stackbegin = .;
134        . += 0x2000;
135        stackend = .;
136     } > SRAM
138     .bss :
139     {
140        _edata = .;
141         *(.bss*)
142         *(COMMON)
143         . = ALIGN(0x4);
144        _end = .;
145     } > DRAM
147     .audiobuf ALIGN(4) :
148     {
149         _audiobuffer = .;
150         audiobuffer = .;
151     } > DRAM
153     .audiobufend ENDAUDIOADDR:
154     {
155         audiobufend = .;
156         _audiobufend = .;
157     } > DRAM
159     .codec ENDAUDIOADDR:
160     {
161         codecbuf = .;
162         _codecbuf = .;
163     }
165     .plugin ENDADDR:
166     {
167         _pluginbuf = .;
168         pluginbuf = .;
169     }