blob: 6464b0d6082c88b0ae7b1828c630461eaf73e988 [file] [log] [blame]
Karl Kurbjunef62d682008-03-13 03:48:23 +00001#include "config.h"
2
3ENTRY(start)
4
5OUTPUT_FORMAT(elf32-littlearm)
6OUTPUT_ARCH(arm)
Jens Arnold2bbacf82008-04-29 06:19:32 +00007STARTUP(target/arm/pnx0101/crt0-pnx0101.o)
Karl Kurbjunef62d682008-03-13 03:48:23 +00008
9#define PLUGINSIZE PLUGIN_BUFFER_SIZE
10#define CODECSIZE CODEC_SIZE
11
12#ifdef DEBUG
13#define STUBOFFSET 0x10000
14#else
15#define STUBOFFSET 0
16#endif
17
18#define DRAMSIZE (MEMORYSIZE * 0x100000) - PLUGINSIZE - STUBOFFSET - CODECSIZE
19
20#define DRAMORIG 0xc00000 + STUBOFFSET
21#define IRAM0ORIG 0x000000
22#define IRAM0SIZE 0x7000
23#define IRAMORIG 0x400000
24#define IRAMSIZE 0x7000
25
26/* End of the audio buffer, where the codec buffer starts */
27#define ENDAUDIOADDR (DRAMORIG + DRAMSIZE)
28
29/* Where the codec buffer ends, and the plugin buffer starts */
30#define ENDADDR (ENDAUDIOADDR + CODECSIZE)
31
32MEMORY
33{
34 DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
35 IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE
36 IRAM0 : ORIGIN = IRAM0ORIG, LENGTH = IRAM0SIZE
37}
38
39SECTIONS
40{
41 .text :
42 {
43 loadaddress = .;
44 _loadaddress = .;
45 . = ALIGN(0x200);
46 *(.init.text)
47 *(.text*)
48 *(.glue_7)
49 *(.glue_7t)
50 . = ALIGN(0x4);
51 } > DRAM
52
53 .rodata :
54 {
55 *(.rodata) /* problems without this, dunno why */
56 *(.rodata*)
57 *(.rodata.str1.1)
58 *(.rodata.str1.4)
59 . = ALIGN(0x4);
60
61 /* Pseudo-allocate the copies of the data sections */
62 _datacopy = .;
63 } > DRAM
64
65 /* TRICK ALERT! For RAM execution, we put the .data section at the
66 same load address as the copy. Thus, we don't waste extra RAM
67 when we don't actually need the copy. */
68 .data : AT ( _datacopy )
69 {
70 _datastart = .;
71 *(.data*)
72 . = ALIGN(0x4);
73 _dataend = .;
74 } > DRAM
75
76 /DISCARD/ :
77 {
78 *(.eh_frame)
79 }
80
81 .vectors 0x0 :
82 {
83 _vectorsstart = .;
84 *(.vectors);
85 _vectorsend = .;
86 *(.dmabuf)
87 } >IRAM0 AT> DRAM
88
89 _vectorscopy = LOADADDR(.vectors);
90
91 .iram IRAMORIG + SIZEOF(.vectors) :
92 {
93 _iramstart = .;
94 *(.icode)
95 *(.irodata)
96 *(.idata)
Robert Kuklafeb3b582008-04-07 18:24:23 +000097 . = ALIGN(0x4);
Karl Kurbjunef62d682008-03-13 03:48:23 +000098 _iramend = .;
99 } > IRAM AT> DRAM
100
101 _iramcopy = LOADADDR(.iram);
102
103 .ibss (NOLOAD) :
104 {
105 _iedata = .;
106 *(.ibss)
107 . = ALIGN(0x4);
108 _iend = .;
109 } > IRAM
110
111 .stack :
112 {
113 *(.stack)
114 stackbegin = .;
115 . += 0x2000;
116 stackend = .;
117 } > IRAM
118
119 .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram) + SIZEOF(.vectors):
120 {
121 _edata = .;
122 *(.bss*)
123 *(COMMON)
124 . = ALIGN(0x4);
125 _end = .;
126 } > DRAM
127
128 .audiobuf ALIGN(4) :
129 {
130 _audiobuffer = .;
131 audiobuffer = .;
132 } > DRAM
133
134 .audiobufend ENDAUDIOADDR:
135 {
136 audiobufend = .;
137 _audiobufend = .;
138 } > DRAM
139
140 .codec ENDAUDIOADDR:
141 {
142 codecbuf = .;
143 _codecbuf = .;
144 }
145
146 .plugin ENDADDR:
147 {
148 _pluginbuf = .;
149 pluginbuf = .;
150 }
151}
152