diff options
Diffstat (limited to 'firmware/target/arm/pnx0101/app.lds')
-rw-r--r-- | firmware/target/arm/pnx0101/app.lds | 151 |
1 files changed, 151 insertions, 0 deletions
diff --git a/firmware/target/arm/pnx0101/app.lds b/firmware/target/arm/pnx0101/app.lds new file mode 100644 index 0000000000..28ca53736d --- /dev/null +++ b/firmware/target/arm/pnx0101/app.lds | |||
@@ -0,0 +1,151 @@ | |||
1 | #include "config.h" | ||
2 | |||
3 | ENTRY(start) | ||
4 | |||
5 | OUTPUT_FORMAT(elf32-littlearm) | ||
6 | OUTPUT_ARCH(arm) | ||
7 | INPUT(target/arm/pnx0101/crt0-pnx0101.o) | ||
8 | |||
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 | |||
32 | MEMORY | ||
33 | { | ||
34 | DRAM : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE | ||
35 | IRAM : ORIGIN = IRAMORIG, LENGTH = IRAMSIZE | ||
36 | IRAM0 : ORIGIN = IRAM0ORIG, LENGTH = IRAM0SIZE | ||
37 | } | ||
38 | |||
39 | SECTIONS | ||
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) | ||
97 | _iramend = .; | ||
98 | } > IRAM AT> DRAM | ||
99 | |||
100 | _iramcopy = LOADADDR(.iram); | ||
101 | |||
102 | .ibss (NOLOAD) : | ||
103 | { | ||
104 | _iedata = .; | ||
105 | *(.ibss) | ||
106 | . = ALIGN(0x4); | ||
107 | _iend = .; | ||
108 | } > IRAM | ||
109 | |||
110 | .stack : | ||
111 | { | ||
112 | *(.stack) | ||
113 | stackbegin = .; | ||
114 | . += 0x2000; | ||
115 | stackend = .; | ||
116 | } > IRAM | ||
117 | |||
118 | .bss ADDR(.data) + SIZEOF(.data) + SIZEOF(.iram) + SIZEOF(.vectors): | ||
119 | { | ||
120 | _edata = .; | ||
121 | *(.bss*) | ||
122 | *(COMMON) | ||
123 | . = ALIGN(0x4); | ||
124 | _end = .; | ||
125 | } > DRAM | ||
126 | |||
127 | .audiobuf ALIGN(4) : | ||
128 | { | ||
129 | _audiobuffer = .; | ||
130 | audiobuffer = .; | ||
131 | } > DRAM | ||
132 | |||
133 | .audiobufend ENDAUDIOADDR: | ||
134 | { | ||
135 | audiobufend = .; | ||
136 | _audiobufend = .; | ||
137 | } > DRAM | ||
138 | |||
139 | .codec ENDAUDIOADDR: | ||
140 | { | ||
141 | codecbuf = .; | ||
142 | _codecbuf = .; | ||
143 | } | ||
144 | |||
145 | .plugin ENDADDR: | ||
146 | { | ||
147 | _pluginbuf = .; | ||
148 | pluginbuf = .; | ||
149 | } | ||
150 | } | ||
151 | |||