Fix voicing of incorrect run time (top time instead of run time). Simplify runtime...
[kugel-rb.git] / apps / plugins / plugin.lds
blob418e29fc99105c264a87d3788def71d5adc9ecc7
1 #include "config.h"
3 /* These output formats should be in the config-files */
5 #ifdef CPU_COLDFIRE
6 OUTPUT_FORMAT(elf32-m68k)
7 #elif defined(CPU_ARM)
8 OUTPUT_FORMAT(elf32-littlearm)
9 #else
10 OUTPUT_FORMAT(elf32-sh)
11 #endif
13 #ifdef DEBUG
14 #define STUBOFFSET 0x10000
15 #else
16 #define STUBOFFSET 0
17 #endif
19 #if defined(CPU_PP)
20 #ifdef CPU_PP502x
21 #define NOCACHE_BASE    0x10000000
22 #else
23 #define NOCACHE_BASE    0x28000000
24 #endif /* CPU_* */
25 #define CACHEALIGN_SIZE 16
26 #endif /* CPU_PP */
28 #ifndef NOCACHE_BASE
29 /* Default to no offset if target doesn't define this */
30 #define NOCACHE_BASE 0x00000000
31 #endif
33 #if CONFIG_CPU==DM320 || CONFIG_CPU==S3C2440
34 #include "cpu.h"
35 #define DRAMSIZE (MEMORYSIZE * 0x100000) - STUBOFFSET - PLUGIN_BUFFER_SIZE - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
36 #elif CONFIG_CPU==IMX31L
37 #include "imx31l.h"
38 /* Reserve 1mb for LCD buffer/TTB as in app.lds */
39 #define DRAMSIZE (MEMORYSIZE * 0x100000 - 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
40 #else
41 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
42 #endif
44 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
45 #define ARCH_IRIVER
46 #endif
48 #if defined(ARCH_IRIVER) || defined(IAUDIO_M3)
49 #define DRAMORIG 0x31000000
50 #define IRAMORIG 0x1000c000
51 #define IRAMSIZE 0xc000
52 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
53 #define DRAMORIG 0x31000000
54 #define IRAMORIG 0x10010000
55 #define IRAMSIZE 0x10000
56 #elif CONFIG_CPU == PP5022 || CONFIG_CPU == PP5024
57 /* PP5022/24 have 128KB of IRAM */
58 #define DRAMORIG 0x00000000
59 #define IRAMORIG 0x4000c000
60 #define IRAMSIZE 0x14000
61 #elif defined(CPU_PP)
62 /* all other PP's have 96KB of IRAM */
63 #define DRAMORIG 0x00000000
64 #define IRAMORIG 0x4000c000
65 #define IRAMSIZE 0x0c000
66 #elif CONFIG_CPU == PNX0101
67 #define DRAMORIG 0xc00000 + STUBOFFSET
68 #define IRAMORIG 0x407000
69 #define IRAMSIZE 0x9000
70 #elif CONFIG_CPU == S3C2440
71 #define DRAMORIG 0x0 + STUBOFFSET
72 #define IRAM DRAM
73 #define IRAMSIZE 0
74 #elif CONFIG_CPU == IMX31L
75 #define DRAMORIG 0x0 + STUBOFFSET
76 #define IRAM DRAM
77 #define IRAMSIZE 0
78 #elif CONFIG_CPU==DM320
79 #define DRAMORIG 0x00900000 + STUBOFFSET
80 #define IRAMORIG DRAMORIG
81 #define IRAMSIZE 0x4000
82 #define IRAM DRAM
83 #elif defined(CPU_TCC780X)
84 #define DRAMORIG 0x20000000
85 /*#define IRAMORIG 0x1000c000
86 #define IRAMSIZE 0xc000*/
87 #define IRAM DRAM
88 #define IRAMSIZE 0
89 #else
90 #define DRAMORIG 0x09000000 + STUBOFFSET
91 #endif
93 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
95 #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
96 #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
98 #ifdef CODEC
99 #define THIS_LENGTH CODEC_SIZE
100 #define THIS_ORIGIN CODEC_ORIGIN
101 #else
102 #define THIS_LENGTH PLUGIN_LENGTH
103 #define THIS_ORIGIN PLUGIN_ORIGIN
104 #endif
106 MEMORY
108    PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
109 #if defined(IRAMSIZE) && IRAMSIZE != 0
110    PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
111 #endif
114 SECTIONS
116     .header : {
117         _plugin_start_addr = .;
118         plugin_start_addr = .;
119         KEEP(*(.header))
120     } > PLUGIN_RAM
122     .text :
123     {
124         *(.text*)
125 #if defined(IRAMSIZE) && IRAMSIZE == 0
126         *(.icode)
127 #endif
128 #ifdef CPU_ARM
129         *(.glue_7)
130         *(.glue_7t)
131 #endif
132     } > PLUGIN_RAM
134     .rodata :
135     {
136         *(.rodata*)
137 #if defined(IRAMSIZE) && IRAMSIZE == 0
138         *(.irodata)
139 #endif
140         . = ALIGN(0x4);
141     } > PLUGIN_RAM
143     .data :
144     {
145         *(.data*)
146 #if defined(IRAMSIZE) && IRAMSIZE == 0
147         *(.idata)
148 #endif
149     } > PLUGIN_RAM
151 #if NOCACHE_BASE != 0
152     .ncdata . + NOCACHE_BASE :
153     {
154         . = ALIGN(CACHEALIGN_SIZE);
155         *(.ncdata*)
156         . = ALIGN(CACHEALIGN_SIZE);
157     } AT> PLUGIN_RAM
158 #endif
160 #if defined(IRAMSIZE)
161     iramcopy = . - NOCACHE_BASE;
162 #endif
164     /DISCARD/ :
165     {
166         *(.eh_frame)
167     }
169 #if defined(IRAMSIZE) && IRAMSIZE != 0
170     .iram IRAMORIG : AT ( iramcopy)
171     {
172         iramstart = .;
173         *(.icode)
174         *(.irodata)
175         *(.idata)
176         iramend = .;
177     } > PLUGIN_IRAM
180     .ibss (NOLOAD) :
181     {
182         iedata = .;
183         *(.ibss)
184         . = ALIGN(0x4);
185         iend = .;
186     } > PLUGIN_IRAM
187 #endif
189     .bss (NOLOAD) :
190     {
191         plugin_bss_start = .;
192         *(.bss*)
193 #if defined(IRAMSIZE) && IRAMSIZE == 0
194         *(.ibss)
195 #endif
196         *(COMMON)
197         . = ALIGN(0x4);
198     } > PLUGIN_RAM
199     
200 #if NOCACHE_BASE != 0
201     .ncbss . + NOCACHE_BASE (NOLOAD) :
202     {
203         . = ALIGN(CACHEALIGN_SIZE);
204         *(.ncbss*)
205         . = ALIGN(CACHEALIGN_SIZE);
206     } AT> PLUGIN_RAM
207 #endif
209     /* Restore . */
210     .pluginend . - NOCACHE_BASE :
211     {
212         _plugin_end_addr = .;
213         plugin_end_addr = .;
214     }
216     /* Special trick to avoid a linker error when no other sections are
217        left after garbage collection (plugin not for this platform) */
218     .comment 0 :
219     {
220         KEEP(*(.comment))
221     }