source: rc_os_nios2/atk2-sc1_1.3.2/target/nios2_dev_gcc/nios2_dev_de0_nano.ld@ 128

Last change on this file since 128 was 128, checked in by ertl-honda, 9 years ago

追加.

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