Add 2008 to the copyright notice.
[Rockbox.git] / apps / plugins / plugin.lds
blob47969e0537f53eda89d794024ab14a6edcc21dae
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 CONFIG_CPU==S3C2440
20 #include "s3c2440.h"
21 #define DRAMSIZE (MEMORYSIZE * 0x100000) - 0x100 - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
22 #elif CONFIG_CPU==DM320
23 #include "dm320.h"
24 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE - LCD_BUFFER_SIZE - TTB_SIZE
25 #elif CONFIG_CPU==IMX31L
26 #include "imx31l.h"
27 /* Reserve 1mb for LCD buffer/TTB as in app.lds */
28 #define DRAMSIZE (MEMORYSIZE * 0x100000 - 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
29 #else
30 #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGIN_BUFFER_SIZE - STUBOFFSET - CODEC_SIZE
31 #endif
33 #if defined(IRIVER_H100_SERIES) || defined(IRIVER_H300)
34 #define ARCH_IRIVER
35 #endif
37 #ifdef ARCH_IRIVER
38 #define DRAMORIG 0x31000000
39 #define IRAMORIG 0x1000c000
40 #define IRAMSIZE 0xc000
41 #elif defined(IAUDIO_X5) || defined(IAUDIO_M5)
42 #define DRAMORIG 0x31000000
43 #define IRAMORIG 0x10010000
44 #define IRAMSIZE 0x10000
45 #elif defined(CPU_PP)
46 #define DRAMORIG 0x00000000
47 #define IRAMORIG 0x4000c000
48 #define IRAMSIZE 0xc000
49 #elif CONFIG_CPU == PNX0101
50 #define DRAMORIG 0xc00000 + STUBOFFSET
51 #define IRAMORIG 0x407000
52 #define IRAMSIZE 0x9000
53 #elif CONFIG_CPU == S3C2440
54 #define DRAMORIG 0x100 + STUBOFFSET
55 #define IRAMORIG DRAMORIG
56 #define IRAMSIZE 4K
57 #define IRAM DRAM
58 #elif CONFIG_CPU == IMX31L
59 #define DRAMORIG 0x0
60 #define IRAMORIG 0x1FFFC000
61 #define IRAMSIZE 0x4000
62 #elif CONFIG_CPU==DM320
63 #define DRAMORIG 0x00900000 + STUBOFFSET
64 #define IRAMORIG DRAMORIG
65 #define IRAMSIZE 0x4000
66 #define IRAM DRAM
67 #elif defined(CPU_TCC780X)
68 #define DRAMORIG 0x20000000
69 #define IRAMORIG 0x1000c000
70 #define IRAMSIZE 0xc000
71 #else
72 #define DRAMORIG 0x09000000 + STUBOFFSET
73 #endif
75 #define PLUGIN_LENGTH PLUGIN_BUFFER_SIZE
77 #define CODEC_ORIGIN (DRAMORIG + (DRAMSIZE))
78 #define PLUGIN_ORIGIN (CODEC_ORIGIN + CODEC_SIZE)
80 #ifdef CODEC
81 #define THIS_LENGTH CODEC_SIZE
82 #define THIS_ORIGIN CODEC_ORIGIN
83 #else
84 #define THIS_LENGTH PLUGIN_LENGTH
85 #define THIS_ORIGIN PLUGIN_ORIGIN
86 #endif
88 MEMORY
90    PLUGIN_RAM : ORIGIN = THIS_ORIGIN, LENGTH = THIS_LENGTH
91 #if defined(IRAMSIZE)
92    PLUGIN_IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
93 #endif
96 SECTIONS
98     .header : {
99         _plugin_start_addr = .;
100         plugin_start_addr = .;
101         KEEP(*(.header))
102     } > PLUGIN_RAM
104     .text :
105     {
106         *(.text*)
107 #ifdef CPU_ARM
108         *(.glue_7)
109         *(.glue_7t)
110 #endif
111     } > PLUGIN_RAM
113     .rodata :
114     {
115         *(.rodata*)
116         . = ALIGN(0x4);
117     } > PLUGIN_RAM
119     .data :
120     {
121         *(.data*)
122 #if defined(IRAMSIZE)
123         iramcopy = .;
124 #endif
125     } > PLUGIN_RAM
127     /DISCARD/ :
128     {
129         *(.eh_frame)
130     }
132 #if defined(IRAMSIZE)
133     .iram IRAMORIG : AT ( iramcopy)
134     {
135         iramstart = .;
136         *(.icode)
137         *(.irodata)
138         *(.idata)
139         iramend = .;
140     } > PLUGIN_IRAM
142     .ibss (NOLOAD) :
143     {
144         iedata = .;
145         *(.ibss)
146         . = ALIGN(0x4);
147         iend = .;
148     } > PLUGIN_IRAM
149 #endif
151     .bss (NOLOAD) :
152     {
153     plugin_bss_start = .;
154         *(.bss*)
155         *(COMMON)
156         . = ALIGN(0x4);
157         _plugin_end_addr = .;
158         plugin_end_addr = .;
159     } > PLUGIN_RAM
161     /* Special trick to avoid a linker error when no other sections are
162        left after garbage collection (plugin not for this platform) */
163     .comment 0 :
164     {
165         KEEP(*(.comment))
166     }