Split up app.lds to the respective target directories. The portalplayer devices...
[kugel-rb.git] / firmware / target / arm / s3c2440 / app.lds
blob3528ed86bfe06724d36fdb3c4ffcb12e5dcc855d
1 #include "config.h"
3 ENTRY(start)
5 OUTPUT_FORMAT(elf32-littlearm)
6 OUTPUT_ARCH(arm)
7 INPUT(target/arm/s3c2440/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 #include "cpu.h"
19 #define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - STUBOFFSET - PLUGINSIZE - CODECSIZE - LCD_BUFFER_SIZE - TTB_SIZE
21 #define DRAMORIG 0x00000100 + STUBOFFSET
22 #define IRAMORIG DRAMORIG
23 #define IRAM DRAM
24 #define IRAMSIZE 0x1000
26 /* End of the audio buffer, where the codec buffer starts */
27 #define ENDAUDIOADDR  (DRAMORIG + DRAMSIZE)
29 /* Where the codec buffer ends, and the plugin buffer starts */
30 #define ENDADDR (ENDAUDIOADDR + CODECSIZE)
32 MEMORY
34     DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
37 SECTIONS
39     .text :
40     {
41         loadaddress = .;
42         _loadaddress = .;
43         . = ALIGN(0x200);
44         *(.init.text)
45         *(.text*)
46         *(.glue_7)
47         *(.glue_7t)
48         . = ALIGN(0x4);
49     } > DRAM
51     .rodata :
52     {
53         *(.rodata)  /* problems without this, dunno why */
54         *(.rodata*)
55         *(.rodata.str1.1)
56         *(.rodata.str1.4)
57         . = ALIGN(0x4);
59         /* Pseudo-allocate the copies of the data sections */
60         _datacopy = .;
61     } > DRAM
63     /* TRICK ALERT! For RAM execution, we put the .data section at the
64        same load address as the copy. Thus, we don't waste extra RAM
65        when we don't actually need the copy.  */
66     .data : AT ( _datacopy )
67     {
68         _datastart = .;
69         *(.data*)
70         . = ALIGN(0x4);
71         _dataend  = .;
72     } > DRAM
74     /DISCARD/ :
75     {
76         *(.eh_frame)
77     }
79     .vectors 0x0 :
80     {
81         _vectorsstart = .;
82         *(.vectors);
83         _vectorsend = .;
84     } AT> DRAM
86     _vectorscopy = LOADADDR(.vectors);
88     .iram :
89     {
90         _iramstart = .;
91         *(.icode)
92         *(.irodata)
93         *(.idata)
94         _iramend = .;
95     } > DRAM
97     _iramcopy = LOADADDR(.iram);
99     .ibss (NOLOAD) :
100     {
101         _iedata = .;
102         *(.ibss)
103         . = ALIGN(0x4);
104         _iend = .;
105     } > DRAM
107     .stack :
108     {
109        *(.stack)
110        stackbegin = .;
111        . += 0x2000;
112        stackend = .;
113     } > DRAM
115     .bss :
116     {
117        _edata = .;
118         *(.bss*)
119         *(COMMON)
120         . = ALIGN(0x4);
121        _end = .;
122     } > DRAM
124     .audiobuf ALIGN(4) :
125     {
126         _audiobuffer = .;
127         audiobuffer = .;
128     } > DRAM
130     .audiobufend ENDAUDIOADDR:
131     {
132         audiobufend = .;
133         _audiobufend = .;
134     } > DRAM
136     .codec ENDAUDIOADDR:
137     {
138         codecbuf = .;
139         _codecbuf = .;
140     }
142     .plugin ENDADDR:
143     {
144         _pluginbuf = .;
145         pluginbuf = .;
146     }