1 | MEMORY
|
---|
2 | {
|
---|
3 | sdram_UNUSED : ORIGIN = 0x00000000, LENGTH = 0x00000020
|
---|
4 | sdram : ORIGIN = 0x00000020, LENGTH = 0x02000000-0x20
|
---|
5 |
|
---|
6 | ext_flash : ORIGIN = 0x04000000, LENGTH = 0x01000000
|
---|
7 |
|
---|
8 | sram_reset : ORIGIN = 0x05000000, LENGTH = 0x00000020
|
---|
9 | sram : ORIGIN = 0x05000020, LENGTH = 0x00100000-0x20
|
---|
10 | onchip_memory : ORIGIN = 0xA000000, LENGTH = 0x0020000
|
---|
11 | }
|
---|
12 |
|
---|
13 | /* Define symbols for each memory base-address */
|
---|
14 | __alt_mem_ext_flash = 0x00000000 ;
|
---|
15 | __alt_mem_ext_ram = 0x00800000 ;
|
---|
16 | __alt_mem_onchip_ram_64_kbytes = 0x00900000 ;
|
---|
17 | __alt_mem_sdram = 0x05000000 ;
|
---|
18 |
|
---|
19 | PROVIDE(hardware_init_hook = 0);
|
---|
20 | PROVIDE(software_init_hook = 0);
|
---|
21 | PROVIDE(software_term_hook = 0);
|
---|
22 | PROVIDE( __alt_data_end = 0x02000000 );
|
---|
23 |
|
---|
24 | PROVIDE(StartupHook = 0);
|
---|
25 | PROVIDE(ShutdownHook = 0);
|
---|
26 | PROVIDE(PreTaskHook = 0);
|
---|
27 | PROVIDE(PostTaskHook = 0);
|
---|
28 | PROVIDE(ErrorHook = 0);
|
---|
29 | PROVIDE(ProtectionHook = 0);
|
---|
30 |
|
---|
31 | OUTPUT_FORMAT( "elf32-littlenios2",
|
---|
32 | "elf32-littlenios2",
|
---|
33 | "elf32-littlenios2" )
|
---|
34 | OUTPUT_ARCH( nios2 )
|
---|
35 | STARTUP(start.o)
|
---|
36 | ENTRY(__reset)
|
---|
37 |
|
---|
38 | /* Do we need any of these for elf?
|
---|
39 | __DYNAMIC = 0;
|
---|
40 | */
|
---|
41 |
|
---|
42 | SECTIONS
|
---|
43 | {
|
---|
44 | .entry :
|
---|
45 | {
|
---|
46 | KEEP (*(.entry))
|
---|
47 | } > sram_reset
|
---|
48 |
|
---|
49 | .exceptions :
|
---|
50 | {
|
---|
51 | . = ALIGN(0x20);
|
---|
52 | *(.irq)
|
---|
53 | KEEP (*(.exceptions));
|
---|
54 | } > sdram
|
---|
55 |
|
---|
56 | .text :
|
---|
57 | {
|
---|
58 | /*
|
---|
59 | * All code sections are merged into the text output section, along with
|
---|
60 | * the read only data sections.
|
---|
61 | *
|
---|
62 | */
|
---|
63 |
|
---|
64 | PROVIDE (stext = ABSOLUTE(.));
|
---|
65 |
|
---|
66 | *(.interp)
|
---|
67 | *(.hash)
|
---|
68 | *(.dynsym)
|
---|
69 | *(.dynstr)
|
---|
70 | *(.gnu.version)
|
---|
71 | *(.gnu.version_d)
|
---|
72 | *(.gnu.version_r)
|
---|
73 | *(.rel.init)
|
---|
74 | *(.rela.init)
|
---|
75 | *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
|
---|
76 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
|
---|
77 | *(.rel.fini)
|
---|
78 | *(.rela.fini)
|
---|
79 | *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
|
---|
80 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
|
---|
81 | *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
|
---|
82 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
|
---|
83 | *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
|
---|
84 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
|
---|
85 | *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
|
---|
86 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
|
---|
87 | *(.rel.ctors)
|
---|
88 | *(.rela.ctors)
|
---|
89 | *(.rel.dtors)
|
---|
90 | *(.rela.dtors)
|
---|
91 | *(.rel.got)
|
---|
92 | *(.rela.got)
|
---|
93 | *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
|
---|
94 | *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
|
---|
95 | *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
|
---|
96 | *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
|
---|
97 | *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
|
---|
98 | *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
|
---|
99 | *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
|
---|
100 | *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
|
---|
101 | *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
|
---|
102 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
|
---|
103 | *(.rel.plt)
|
---|
104 | *(.rela.plt)
|
---|
105 |
|
---|
106 | KEEP (*(.init))
|
---|
107 | *(.plt)
|
---|
108 | *(.text .stub .text.* .gnu.linkonce.t.*)
|
---|
109 |
|
---|
110 | /* .gnu.warning sections are handled specially by elf32.em. */
|
---|
111 |
|
---|
112 | *(.gnu.warning.*)
|
---|
113 | KEEP (*(.fini))
|
---|
114 | PROVIDE (__etext = ABSOLUTE(.));
|
---|
115 | PROVIDE (_etext = ABSOLUTE(.));
|
---|
116 | PROVIDE (etext = ABSOLUTE(.));
|
---|
117 |
|
---|
118 | *(.eh_frame_hdr)
|
---|
119 | /* Ensure the __preinit_array_start label is properly aligned. We
|
---|
120 | could instead move the label definition inside the section, but
|
---|
121 | the linker would then create the section even if it turns out to
|
---|
122 | be empty, which isn't pretty. */
|
---|
123 | . = ALIGN(32 / 8);
|
---|
124 | PROVIDE (__preinit_array_start = ABSOLUTE(.));
|
---|
125 | *(.preinit_array)
|
---|
126 | PROVIDE (__preinit_array_end = ABSOLUTE(.));
|
---|
127 | PROVIDE (__init_array_start = ABSOLUTE(.));
|
---|
128 | *(.init_array)
|
---|
129 | PROVIDE (__init_array_end = ABSOLUTE(.));
|
---|
130 | PROVIDE (__fini_array_start = ABSOLUTE(.));
|
---|
131 | *(.fini_array)
|
---|
132 | PROVIDE (__fini_array_end = ABSOLUTE(.));
|
---|
133 | SORT(CONSTRUCTORS)
|
---|
134 | KEEP (*(.eh_frame))
|
---|
135 | *(.gcc_except_table)
|
---|
136 | *(.dynamic)
|
---|
137 |
|
---|
138 | /* gcc normally uses crtbegin.o to find the start of
|
---|
139 | the constructors instead nios2 use crtdotors.o,
|
---|
140 | so we make sure it is
|
---|
141 | first. Because this is a wildcard, it
|
---|
142 | doesn't matter if the user does not
|
---|
143 | actually link against crtdotors.o; the
|
---|
144 | linker won't look for a file to match a
|
---|
145 | wildcard. The wildcard also means that it
|
---|
146 | doesn't matter which directory crtdotors.o
|
---|
147 | is in. */
|
---|
148 | KEEP (*crtdotors.o(.ctors))
|
---|
149 | /* We don't want to include the .ctor section from
|
---|
150 | from the crtendtors (gcc normally uses crtend.o)
|
---|
151 | file until after the sorted ctors.
|
---|
152 | The .ctor section from the crtendtors file contains the
|
---|
153 | end of ctors marker and it must be last */
|
---|
154 | KEEP (*(EXCLUDE_FILE (*crtendtors.o ) .ctors))
|
---|
155 | KEEP (*(SORT(.ctors.*)))
|
---|
156 | KEEP (*(.ctors))
|
---|
157 | KEEP (*crtdotors.o(.dtors))
|
---|
158 | KEEP (*(EXCLUDE_FILE (*crtendtors.o ) .dtors))
|
---|
159 | KEEP (*(SORT(.dtors.*)))
|
---|
160 | KEEP (*(.dtors))
|
---|
161 | KEEP (*(.jcr))
|
---|
162 | } > onchip_memory =0x0001883a /* NOP on Nios2 */
|
---|
163 |
|
---|
164 | .rodata :
|
---|
165 | {
|
---|
166 | . = ALIGN(32 / 8);
|
---|
167 | *(.rodata .rodata.* .gnu.linkonce.r.*)
|
---|
168 | *(.rodata1)
|
---|
169 | } > onchip_memory
|
---|
170 |
|
---|
171 | .rwdata :
|
---|
172 | {
|
---|
173 | . = ALIGN(32 / 8);
|
---|
174 | *(.got.plt) *(.got)
|
---|
175 | *(.data1)
|
---|
176 | *(.data .data.* .gnu.linkonce.d.*)
|
---|
177 |
|
---|
178 | _gp = ABSOLUTE(. + 0x7ff0);
|
---|
179 | PROVIDE(gp = _gp);
|
---|
180 |
|
---|
181 | *(.sdata .sdata.* .gnu.linkonce.s.*)
|
---|
182 | *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
|
---|
183 |
|
---|
184 | . = ALIGN(32 / 8);
|
---|
185 | _edata = ABSOLUTE(.);
|
---|
186 | PROVIDE (edata = ABSOLUTE(.));
|
---|
187 | } > onchip_memory
|
---|
188 |
|
---|
189 | .bss :
|
---|
190 | {
|
---|
191 | __bss_start = ABSOLUTE(.);
|
---|
192 | PROVIDE (__sbss_start = ABSOLUTE(.));
|
---|
193 | PROVIDE (___sbss_start = ABSOLUTE(.));
|
---|
194 |
|
---|
195 | *(.dynsbss)
|
---|
196 | *(.sbss .sbss.* .gnu.linkonce.sb.*)
|
---|
197 | *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
|
---|
198 | *(.scommon)
|
---|
199 |
|
---|
200 | PROVIDE (__sbss_end = ABSOLUTE(.));
|
---|
201 | PROVIDE (___sbss_end = ABSOLUTE(.));
|
---|
202 |
|
---|
203 | *(.dynbss)
|
---|
204 | *(.bss .bss.* .gnu.linkonce.b.*)
|
---|
205 | *(COMMON)
|
---|
206 |
|
---|
207 | . = ALIGN(32 / 8);
|
---|
208 | __bss_end = ABSOLUTE(.);
|
---|
209 | } > onchip_memory
|
---|
210 |
|
---|
211 | /*
|
---|
212 | * One output section for each of the available partitions. These are not
|
---|
213 | * used by default, but can be used by users applications using the .section
|
---|
214 | * directive.
|
---|
215 | *
|
---|
216 | * The memory partition used for the heap is treated in special way, i.e. a
|
---|
217 | * symbol is added to point to the heap start.
|
---|
218 | *
|
---|
219 | */
|
---|
220 |
|
---|
221 | .ext_flash :
|
---|
222 | {
|
---|
223 | PROVIDE (_alt_partition_ext_flash_start = ABSOLUTE(.));
|
---|
224 | *(.ext_flash)
|
---|
225 | . = ALIGN(32 / 8);
|
---|
226 | PROVIDE (_alt_partition_ext_flash_end = ABSOLUTE(.));
|
---|
227 | } > ext_flash
|
---|
228 |
|
---|
229 | .sram :
|
---|
230 | {
|
---|
231 | PROVIDE (_alt_partition_sram_start = ABSOLUTE(.));
|
---|
232 | *(.sram)
|
---|
233 | . = ALIGN(32 / 8);
|
---|
234 | PROVIDE (_alt_partition_sram_end = ABSOLUTE(.));
|
---|
235 | _end = ABSOLUTE(.);
|
---|
236 | PROVIDE (end = ABSOLUTE(.));
|
---|
237 | } > sram
|
---|
238 |
|
---|
239 | .onchip_memory :
|
---|
240 | {
|
---|
241 | PROVIDE (_alt_partition_onchip_memory_start = ABSOLUTE(.));
|
---|
242 | *(.onchip_memory)
|
---|
243 | . = ALIGN(32 / 8);
|
---|
244 | PROVIDE (_alt_partition_onchip_memory_end = ABSOLUTE(.));
|
---|
245 | _end = ABSOLUTE(.);
|
---|
246 | PROVIDE (end = ABSOLUTE(.));
|
---|
247 | } > onchip_memory
|
---|
248 |
|
---|
249 | .nlonchip_memory (NOLOAD):
|
---|
250 | {
|
---|
251 | PROVIDE (_alt_partition_nlonchip_memory_start = ABSOLUTE(.));
|
---|
252 | *(.nlonchip_memory)
|
---|
253 | . = ALIGN(32 / 8);
|
---|
254 | PROVIDE (_alt_partition_nlonchip_memory_end = ABSOLUTE(.));
|
---|
255 | _end = ABSOLUTE(.);
|
---|
256 | PROVIDE (end = ABSOLUTE(.));
|
---|
257 | } > onchip_memory
|
---|
258 |
|
---|
259 | /*
|
---|
260 | * Stabs debugging sections.
|
---|
261 | *
|
---|
262 | */
|
---|
263 |
|
---|
264 | .stab 0 : { *(.stab) }
|
---|
265 | .stabstr 0 : { *(.stabstr) }
|
---|
266 | .stab.excl 0 : { *(.stab.excl) }
|
---|
267 | .stab.exclstr 0 : { *(.stab.exclstr) }
|
---|
268 | .stab.index 0 : { *(.stab.index) }
|
---|
269 | .stab.indexstr 0 : { *(.stab.indexstr) }
|
---|
270 | .comment 0 : { *(.comment) }
|
---|
271 | /* DWARF debug sections.
|
---|
272 | Symbols in the DWARF debugging sections are relative to the beginning
|
---|
273 | of the section so we begin them at 0. */
|
---|
274 | /* DWARF 1 */
|
---|
275 | .debug 0 : { *(.debug) }
|
---|
276 | .line 0 : { *(.line) }
|
---|
277 | /* GNU DWARF 1 extensions */
|
---|
278 | .debug_srcinfo 0 : { *(.debug_srcinfo) }
|
---|
279 | .debug_sfnames 0 : { *(.debug_sfnames) }
|
---|
280 | /* DWARF 1.1 and DWARF 2 */
|
---|
281 | .debug_aranges 0 : { *(.debug_aranges) }
|
---|
282 | .debug_pubnames 0 : { *(.debug_pubnames) }
|
---|
283 | /* DWARF 2 */
|
---|
284 | .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
|
---|
285 | .debug_abbrev 0 : { *(.debug_abbrev) }
|
---|
286 | .debug_line 0 : { *(.debug_line) }
|
---|
287 | .debug_frame 0 : { *(.debug_frame) }
|
---|
288 | .debug_str 0 : { *(.debug_str) }
|
---|
289 | .debug_loc 0 : { *(.debug_loc) }
|
---|
290 | .debug_macinfo 0 : { *(.debug_macinfo) }
|
---|
291 | /* SGI/MIPS DWARF 2 extensions */
|
---|
292 | .debug_weaknames 0 : { *(.debug_weaknames) }
|
---|
293 | .debug_funcnames 0 : { *(.debug_funcnames) }
|
---|
294 | .debug_typenames 0 : { *(.debug_typenames) }
|
---|
295 | .debug_varnames 0 : { *(.debug_varnames) }
|
---|
296 | }
|
---|
297 | /* provide a pointer for the stack */
|
---|
298 |
|
---|
299 |
|
---|