diff options
Diffstat (limited to 'firmware/target/sh/archos/app.lds')
-rw-r--r-- | firmware/target/sh/archos/app.lds | 145 |
1 files changed, 145 insertions, 0 deletions
diff --git a/firmware/target/sh/archos/app.lds b/firmware/target/sh/archos/app.lds new file mode 100644 index 0000000000..94cb437706 --- /dev/null +++ b/firmware/target/sh/archos/app.lds | |||
@@ -0,0 +1,145 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | |||
5 | OUTPUT_FORMAT(elf32-sh) | ||
6 | INPUT(target/sh/crt0.o) | ||
7 | |||
8 | #define PLUGINSIZE PLUGIN_BUFFER_SIZE | ||
9 | #define CODECSIZE CODEC_SIZE | ||
10 | |||
11 | #ifdef DEBUG | ||
12 | #define STUBOFFSET 0x10000 | ||
13 | #else | ||
14 | #define STUBOFFSET 0 | ||
15 | #endif | ||
16 | |||
17 | #define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE | ||
18 | |||
19 | #define DRAMORIG 0x09000000 + STUBOFFSET | ||
20 | #define IRAMORIG 0x0f000000 | ||
21 | #define IRAMSIZE 0x1000 | ||
22 | |||
23 | /* End of the audio buffer, where the codec buffer starts */ | ||
24 | #define ENDAUDIOADDR (DRAMORIG + DRAMSIZE) | ||
25 | |||
26 | /* Where the codec buffer ends, and the plugin buffer starts */ | ||
27 | #define ENDADDR (ENDAUDIOADDR + CODECSIZE) | ||
28 | |||
29 | MEMORY | ||
30 | { | ||
31 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
32 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
33 | } | ||
34 | |||
35 | SECTIONS | ||
36 | { | ||
37 | .vectors : | ||
38 | { | ||
39 | loadaddress = .; | ||
40 | _loadaddress = .; | ||
41 | KEEP(*(.resetvectors)); | ||
42 | *(.resetvectors); | ||
43 | KEEP(*(.vectors)); | ||
44 | *(.vectors); | ||
45 | } > DRAM | ||
46 | |||
47 | .text : | ||
48 | { | ||
49 | . = ALIGN(0x200); | ||
50 | *(.init.text) | ||
51 | *(.text*) | ||
52 | . = ALIGN(0x4); | ||
53 | } > DRAM | ||
54 | |||
55 | .rodata : | ||
56 | { | ||
57 | *(.rodata) /* problems without this, dunno why */ | ||
58 | *(.rodata*) | ||
59 | *(.rodata.str1.1) | ||
60 | *(.rodata.str1.4) | ||
61 | . = ALIGN(0x4); | ||
62 | |||
63 | /* Pseudo-allocate the copies of the data sections */ | ||
64 | _datacopy = .; | ||
65 | } > DRAM | ||
66 | |||
67 | /* TRICK ALERT! For RAM execution, we put the .data section at the | ||
68 | same load address as the copy. Thus, we don't waste extra RAM | ||
69 | when we don't actually need the copy. */ | ||
70 | .data : AT ( _datacopy ) | ||
71 | { | ||
72 | _datastart = .; | ||
73 | *(.data*) | ||
74 | . = ALIGN(0x4); | ||
75 | _dataend = .; | ||
76 | } > DRAM | ||
77 | |||
78 | /DISCARD/ : | ||
79 | { | ||
80 | *(.eh_frame) | ||
81 | } | ||
82 | |||
83 | .iram IRAMORIG : | ||
84 | { | ||
85 | _iramstart = .; | ||
86 | *(.icode) | ||
87 | *(.irodata) | ||
88 | *(.idata) | ||
89 | _iramend = .; | ||
90 | } > IRAM AT> DRAM | ||
91 | |||
92 | _iramcopy = LOADADDR(.iram); | ||
93 | |||
94 | .ibss (NOLOAD) : | ||
95 | { | ||
96 | _iedata = .; | ||
97 | *(.ibss) | ||
98 | . = ALIGN(0x4); | ||
99 | _iend = .; | ||
100 | } > IRAM | ||
101 | |||
102 | /* TRICK ALERT! We want 0x2000 bytes of stack, but we set the section | ||
103 | size smaller, and allow the stack to grow into the .iram copy */ | ||
104 | .stack ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram): | ||
105 | { | ||
106 | *(.stack) | ||
107 | _stackbegin = . - SIZEOF(.iram); | ||
108 | . += 0x2000 - SIZEOF(.iram); | ||
109 | _stackend = .; | ||
110 | } > DRAM | ||
111 | |||
112 | .bss : | ||
113 | { | ||
114 | _edata = .; | ||
115 | *(.bss*) | ||
116 | *(COMMON) | ||
117 | . = ALIGN(0x4); | ||
118 | _end = .; | ||
119 | } > DRAM | ||
120 | |||
121 | .audiobuf ALIGN(4) : | ||
122 | { | ||
123 | _audiobuffer = .; | ||
124 | audiobuffer = .; | ||
125 | } > DRAM | ||
126 | |||
127 | .audiobufend ENDAUDIOADDR: | ||
128 | { | ||
129 | audiobufend = .; | ||
130 | _audiobufend = .; | ||
131 | } > DRAM | ||
132 | |||
133 | .codec ENDAUDIOADDR: | ||
134 | { | ||
135 | codecbuf = .; | ||
136 | _codecbuf = .; | ||
137 | } | ||
138 | |||
139 | .plugin ENDADDR: | ||
140 | { | ||
141 | _pluginbuf = .; | ||
142 | pluginbuf = .; | ||
143 | } | ||
144 | } | ||
145 | |||