source: rtems/c/src/lib/libbsp/nios2/nios2_iss/startup/linkcmds @ 69722ac9

4.104.115
Last change on this file since 69722ac9 was 69722ac9, checked in by Joel Sherrill <joel.sherrill@…>, on Apr 6, 2009 at 3:25:56 PM

2009-04-06 Joel Sherrill <joel.sherrill@…>

  • startup/linkcmds: Move stack so it does not overlap workarea.
  • Property mode set to 100644
File size: 10.3 KB
Line 
1/* generated.x
2 *
3 * Machine generated for a CPU named "cpu_0" as defined in:
4 * D:\eb2_nios2\kawkos.ptf
5 *
6 * Generated: 2005-07-10 11:52:46.899
7 *
8 */
9
10/*
11
12DO NOT MODIFY THIS FILE
13
14   Changing this file will have subtle consequences
15   which will almost certainly lead to a nonfunctioning
16   system. If you do modify this file, be aware that your
17   changes will be overwritten and lost when this file
18   is generated again.
19
20DO NOT MODIFY THIS FILE
21
22*/
23
24RamBase = DEFINED(RamBase) ? RamBase : 0x00000000;
25RamSize = DEFINED(RamSize) ? RamSize : 0x00800000;
26HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
27StackSize = DEFINED(StackSize) ? HeapSize : 1024;
28
29MEMORY
30{
31    reset : ORIGIN = 0x00000000, LENGTH = 0x00000600
32    exceptions : ORIGIN = 0x00000600, LENGTH = 0x00000A00
33    onchip_memory_0 : ORIGIN = 0x00001000, LENGTH = 0x007FF000
34}
35
36    /* Define symbols for each memory base-address */
37 __alt_mem_onchip_memory_0 = 0x00000000 ;
38
39 __nios2_icache_size = 4096 ;
40 __nios2_icache_line_size = 32 ;
41 __nios2_dcache_size = 0 ;
42 __nios2_dcache_line_size = 4 ;
43
44OUTPUT_FORMAT( "elf32-littlenios2",
45               "elf32-littlenios2",
46               "elf32-littlenios2" )
47OUTPUT_ARCH( nios2 )
48ENTRY( _start )
49
50/* Do we need any of these for elf?
51   __DYNAMIC = 0;
52 */
53
54SECTIONS
55{
56    .entry :
57    {
58        KEEP (*(.entry))
59    } > reset
60
61    .exceptions :
62    {
63        PROVIDE (__ram_exceptions_start = ABSOLUTE(.));
64        . = ALIGN(0x20);
65        *(.irq)
66        KEEP (*(.exceptions.entry.label));
67        KEEP (*(.exceptions.entry.user));
68        KEEP (*(.exceptions.entry));
69        KEEP (*(.exceptions.irqtest.user));
70        KEEP (*(.exceptions.irqtest));
71        KEEP (*(.exceptions.irqhandler.user));
72        KEEP (*(.exceptions.irqhandler));
73        KEEP (*(.exceptions.irqreturn.user));
74        KEEP (*(.exceptions.irqreturn));
75        KEEP (*(.exceptions.notirq.label));
76        KEEP (*(.exceptions.notirq.user));
77        KEEP (*(.exceptions.notirq));
78        KEEP (*(.exceptions.soft.user));
79        KEEP (*(.exceptions.soft));
80        KEEP (*(.exceptions.unknown.user));
81        KEEP (*(.exceptions.unknown));
82        KEEP (*(.exceptions.exit.label));
83        KEEP (*(.exceptions.exit.user));
84        KEEP (*(.exceptions.exit));
85        KEEP (*(.exceptions));
86        PROVIDE (__ram_exceptions_end = ABSOLUTE(.));
87    } > exceptions
88
89    PROVIDE (__flash_exceptions_start = LOADADDR(.exceptions));
90
91    .text :
92    {
93        /*
94         * All code sections are merged into the text output section, along with
95         * the read only data sections.
96         *
97         */
98
99        PROVIDE (stext = ABSOLUTE(.));
100
101        *(.interp)
102        *(.hash)
103        *(.dynsym)
104        *(.dynstr)
105        *(.gnu.version)
106        *(.gnu.version_d)
107        *(.gnu.version_r)
108        *(.rel.init)
109        *(.rela.init)
110        *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
111        *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
112        *(.rel.fini)
113        *(.rela.fini)
114        *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
115        *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
116        *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
117        *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
118        *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
119        *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
120        *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
121        *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
122        *(.rel.ctors)
123        *(.rela.ctors)
124        *(.rel.dtors)
125        *(.rela.dtors)
126        *(.rel.got)
127        *(.rela.got)
128        *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
129        *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
130        *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
131        *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
132        *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
133        *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
134        *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
135        *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
136        *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
137        *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
138        *(.rel.plt)
139        *(.rela.plt)
140
141        KEEP (*(.init))
142        *(.plt)
143        *(.text .stub .text.* .gnu.linkonce.t.*)
144
145        /* Special FreeBSD sysctl sections.  */
146        . = ALIGN (16);
147        __start_set_sysctl_set = .;
148        *(set_sysctl_*);
149        __stop_set_sysctl_set = ABSOLUTE(.);
150        *(set_domain_*);
151        *(set_pseudo_*);
152
153/* .gnu.warning sections are handled specially by elf32.em.  */
154
155        *(.gnu.warning.*)
156        KEEP (*(.fini))
157        PROVIDE (__etext = ABSOLUTE(.));
158        PROVIDE (_etext = ABSOLUTE(.));
159        PROVIDE (etext = ABSOLUTE(.));
160
161        *(.eh_frame_hdr)
162        /* Ensure the __preinit_array_start label is properly aligned.  We
163           could instead move the label definition inside the section, but
164           the linker would then create the section even if it turns out to
165           be empty, which isn't pretty.  */
166        . = ALIGN(32 / 8);
167        PROVIDE (__preinit_array_start = ABSOLUTE(.));
168        *(.preinit_array)
169        PROVIDE (__preinit_array_end = ABSOLUTE(.));
170        PROVIDE (__init_array_start = ABSOLUTE(.));
171        *(.init_array)
172        PROVIDE (__init_array_end = ABSOLUTE(.));
173        PROVIDE (__fini_array_start = ABSOLUTE(.));
174        *(.fini_array)
175        PROVIDE (__fini_array_end = ABSOLUTE(.));
176        SORT(CONSTRUCTORS)
177        KEEP (*(.eh_frame))
178        *(.gcc_except_table*)
179        *(.dynamic)
180        PROVIDE (__CTOR_LIST__ = ABSOLUTE(.));
181        KEEP (*(.ctors))
182        KEEP (*(SORT(.ctors.*)))
183        PROVIDE (__CTOR_END__ = ABSOLUTE(.));
184        PROVIDE (__DTOR_LIST__ = ABSOLUTE(.));
185        KEEP (*(.dtors))
186        KEEP (*(SORT(.dtors.*)))
187        PROVIDE (__DTOR_END__ = ABSOLUTE(.));
188        KEEP (*(.jcr))
189        . = ALIGN(32 / 8);
190    } >  onchip_memory_0 = 0x3a880100 /* NOP on Nios2 (big endian) */
191
192    .rodata :
193    {
194        PROVIDE (__ram_rodata_start = ABSOLUTE(.));
195        . = ALIGN(32 / 8);
196        *(.rodata .rodata.* .gnu.linkonce.r.*)
197        *(.rodata1)
198        . = ALIGN(32 / 8);
199        PROVIDE (__ram_rodata_end = ABSOLUTE(.));
200    } > onchip_memory_0
201
202    PROVIDE (__flash_rodata_start = LOADADDR(.rodata));
203
204    .rwdata  :
205    {
206        PROVIDE (__ram_rwdata_start = ABSOLUTE(.));
207        . = ALIGN(32 / 8);
208        *(.got.plt) *(.got)
209        *(.data1)
210        *(.data .data.* .gnu.linkonce.d.*)
211
212        _gp = ABSOLUTE(. + 0x8000);
213        PROVIDE(gp = _gp);
214
215        *(.sdata .sdata.* .gnu.linkonce.s.*)
216        *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
217
218        . = ALIGN(32 / 8);
219        _edata = ABSOLUTE(.);
220        PROVIDE (edata = ABSOLUTE(.));
221        PROVIDE (__ram_rwdata_end = ABSOLUTE(.));
222    } > onchip_memory_0
223
224    PROVIDE (__flash_rwdata_start = LOADADDR(.rwdata));
225
226    .bss :
227    {
228        __bss_start = ABSOLUTE(.);
229        PROVIDE (__sbss_start = ABSOLUTE(.));
230        PROVIDE (___sbss_start = ABSOLUTE(.));
231
232        *(.dynsbss)
233        *(.sbss .sbss.* .gnu.linkonce.sb.*)
234        *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
235        *(.scommon)
236
237        PROVIDE (__sbss_end = ABSOLUTE(.));
238        PROVIDE (___sbss_end = ABSOLUTE(.));
239
240        *(.dynbss)
241        *(.bss .bss.* .gnu.linkonce.b.*)
242        *(COMMON)
243
244        . = ALIGN(32 / 8);
245        __bss_end = ABSOLUTE(.);
246        _stack_low = ABSOLUTE(.);
247        . += StackSize;
248        _stack_high = ABSOLUTE(.);
249        WorkAreaBase = .;
250    } > onchip_memory_0
251
252    /*
253     * One output section for each of the available partitions. These are not
254     * used by default, but can be used by users applications using the .section
255     * directive.
256     *
257     * The memory partition used for the heap is treated in  special way, i.e. a
258     * symbol is added to point to the heap start.
259     *
260     * Note that when running from flash, these sections are not loaded by the
261     * HAL.
262     *
263     */
264
265    .onchip_memory_0 :
266    {
267        PROVIDE (_alt_partition_onchip_memory_0_start = ABSOLUTE(.));
268        *(.onchip_memory_0 .onchip_memory_0.*)
269        . = ALIGN(32 / 8);
270        PROVIDE (_alt_partition_onchip_memory_0_end = ABSOLUTE(.));
271        _end = ABSOLUTE(.);
272        end = ABSOLUTE(.);
273
274    } > onchip_memory_0
275
276    PROVIDE (_alt_partition_onchip_memory_0_load_addr = LOADADDR(.onchip_memory_0));
277
278    /*
279     * Stabs debugging sections.
280     *
281     */
282
283    .stab          0 : { *(.stab) }
284    .stabstr       0 : { *(.stabstr) }
285    .stab.excl     0 : { *(.stab.excl) }
286    .stab.exclstr  0 : { *(.stab.exclstr) }
287    .stab.index    0 : { *(.stab.index) }
288    .stab.indexstr 0 : { *(.stab.indexstr) }
289    .comment       0 : { *(.comment) }
290    /* DWARF debug sections.
291       Symbols in the DWARF debugging sections are relative to the beginning
292       of the section so we begin them at 0.  */
293    /* DWARF 1 */
294    .debug          0 : { *(.debug) }
295    .line           0 : { *(.line) }
296    /* GNU DWARF 1 extensions */
297    .debug_srcinfo  0 : { *(.debug_srcinfo) }
298    .debug_sfnames  0 : { *(.debug_sfnames) }
299    /* DWARF 1.1 and DWARF 2 */
300    .debug_aranges  0 : { *(.debug_aranges) }
301    .debug_pubnames 0 : { *(.debug_pubnames) }
302    /* DWARF 2 */
303    .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
304    .debug_abbrev   0 : { *(.debug_abbrev) }
305    .debug_line     0 : { *(.debug_line) }
306    .debug_frame    0 : { *(.debug_frame) }
307    .debug_str      0 : { *(.debug_str) }
308    .debug_loc      0 : { *(.debug_loc) }
309    .debug_macinfo  0 : { *(.debug_macinfo) }
310    /* SGI/MIPS DWARF 2 extensions */
311    .debug_weaknames 0 : { *(.debug_weaknames) }
312    .debug_funcnames 0 : { *(.debug_funcnames) }
313    .debug_typenames 0 : { *(.debug_typenames) }
314    .debug_varnames  0 : { *(.debug_varnames) }
315
316    /* Altera debug extensions */
317    .debug_alt_sim_info 0 : { *(.debug_alt_sim_info) }
318}
319/* provide a pointer for the stack */
320
321/*
322 * Don't override this, override the __alt_stack_* symbols instead.
323 */
324__alt_data_end = 0x00800000;
325
326/*
327 * The next two symbols define the location of the default stack.  You can
328 * override them to move the stack to a different memory.
329 */
330PROVIDE( __alt_stack_pointer = _stack_high );
331PROVIDE( __alt_stack_limit   = _stack_low );
332
333/*
334 * This symbol controls where the start of the heap is.  If the stack is
335 * contiguous with the heap then the stack will contract as memory is
336 * allocated to the heap.
337 * Override this symbol to put the heap in a different memory.
338 */
339PROVIDE( __alt_heap_start    = end );
340
Note: See TracBrowser for help on using the repository browser.