Imported Upstream version 3.2.2
[debian/gnuradio] / usrp2 / firmware / lib / microblaze.ld
1 OUTPUT_FORMAT("elf32-microblaze", "", "")
2 /* SEARCH_DIR(/home/jwilliams/tmp/microblaze-toolchain-sources/release/lin/microblaze//lib);*/
3
4 ENTRY(_start)
5
6 MEMORY {
7         flatmem : ORIGIN = 0x0, LENGTH = 0x00008000     /* 32KB */
8 }
9
10 SECTIONS
11 {
12   _TEXT_START_ADDR = DEFINED(_TEXT_START_ADDR) ? _TEXT_START_ADDR : 0x50;               
13   .vectors.reset 0x0 : { *(.vectors.reset) } > flatmem
14   .vectors.sw_exception 0x8 : { *(.vectors.sw_exception) } > flatmem
15   .vectors.interrupt 0x10 : { *(.vectors.interrupt) } > flatmem
16   .vectors.hw_exception 0x20 : { *(.vectors.hw_exception) } >flatmem
17   . = _TEXT_START_ADDR;
18    _ftext  =  .;
19   .text : {
20     *(.text)
21     *(.text.*)
22     *(.gnu.linkonce.t.*)
23   } > flatmem
24    _etext  =  .;
25   .init : { KEEP (*(.init))     } > flatmem =0
26   .fini : { KEEP (*(.fini))     } > flatmem =0
27   PROVIDE (__CTOR_LIST__ = .);
28   PROVIDE (___CTOR_LIST__ = .);
29   .ctors   : 
30   {
31     /* gcc uses crtbegin.o to find the start of
32        the constructors, so we make sure it is
33        first.  Because this is a wildcard, it
34        doesn't matter if the user does not
35        actually link against crtbegin.o; the
36        linker won't look for a file to match a
37        wildcard.  The wildcard also means that it
38        doesn't matter which directory crtbegin.o
39        is in.  */
40     KEEP (*crtbegin.o(.ctors))
41     /* We don't want to include the .ctor section from
42        from the crtend.o file until after the sorted ctors.
43        The .ctor section from the crtend file contains the
44        end of ctors marker and it must be last */
45     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
46     KEEP (*(SORT(.ctors.*)))
47     KEEP (*(.ctors))
48   } > flatmem
49   PROVIDE (__CTOR_END__ = .);
50   PROVIDE (___CTOR_END__ = .);
51   PROVIDE (__DTOR_LIST__ = .);
52   PROVIDE (___DTOR_LIST__ = .);
53    .dtors         :
54   {
55     KEEP (*crtbegin.o(.dtors))
56     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
57     KEEP (*(SORT(.dtors.*)))
58     KEEP (*(.dtors))
59   } > flatmem
60   PROVIDE (__DTOR_END__ = .);
61   PROVIDE (___DTOR_END__ = .);
62    . = ALIGN(4);
63     _frodata = . ;
64   .rodata : {
65     *(.rodata)
66     *(.gnu.linkonce.r.*)
67     CONSTRUCTORS; /* Is this needed? */
68   } > flatmem
69    _erodata = .;
70   /* Alignments by 8 to ensure that _SDA2_BASE_ on a word boundary */
71   /* Note that .sdata2 and .sbss2 must be contiguous */
72   . = ALIGN(8);
73    _ssrw = .;
74   .sdata2 : {
75     *(.sdata2)
76     *(.gnu.linkonce.s2.*)
77   } > flatmem
78   . = ALIGN(4);
79   .sbss2 : {
80     PROVIDE (__sbss2_start = .);        
81     *(.sbss2)
82     *(.gnu.linkonce.sb2.*)
83     PROVIDE (__sbss2_end = .);
84   } > flatmem
85   . = ALIGN(8);
86    _essrw = .;
87    _ssrw_size = _essrw - _ssrw;
88    PROVIDE (_SDA2_BASE_ = _ssrw + (_ssrw_size / 2 ));
89    . = ALIGN(4);
90    _fdata = .;
91   .data : {
92     *(.data)
93     *(.gnu.linkonce.d.*)
94     CONSTRUCTORS; /* Is this needed? */
95   } > flatmem
96    _edata = . ;
97    /* Added to handle pic code */
98   .got : {  
99     *(.got)
100   } > flatmem
101   .got1 : {  
102     *(.got1)
103   } > flatmem
104   .got2 : {  
105     *(.got2)
106   } > flatmem
107   /* Added by Sathya to handle C++ exceptions */
108   .eh_frame : {  
109     *(.eh_frame)
110   } > flatmem
111   .jcr : {  
112     *(.jcr)
113   } > flatmem
114   .gcc_except_table : {  
115     *(.gcc_except_table)
116   } > flatmem
117   /* Alignments by 8 to ensure that _SDA_BASE_ on a word boundary */
118   /* Note that .sdata and .sbss must be contiguous */
119   . = ALIGN(8);
120    _ssro = .;
121   .sdata : {
122     *(.sdata)
123     *(.gnu.linkonce.s.*)
124   } > flatmem
125   . = ALIGN(4);
126   .sbss : {
127     PROVIDE (__sbss_start = .); 
128     *(.sbss)
129     *(.gnu.linkonce.sb.*)
130     PROVIDE (__sbss_end = .);
131   } > flatmem
132   . = ALIGN(8);
133    _essro = .;
134    _ssro_size = _essro - _ssro;
135   PROVIDE (_SDA_BASE_ = _ssro + (_ssro_size / 2 ));
136    . = ALIGN(4);
137    _fbss = .;
138   .bss : {
139     PROVIDE (__bss_start = .);  
140     *(.bss)
141     *(.gnu.linkonce.b.*)
142     *(COMMON)
143     . = ALIGN(4);  
144     PROVIDE (__bss_end = .);
145      _heap = .;
146      _HEAP_SIZE = DEFINED(_HEAP_SIZE) ? _HEAP_SIZE : 0x0;
147      _STACK_SIZE = DEFINED(_STACK_SIZE) ? _STACK_SIZE : 0x800;
148      . += _HEAP_SIZE;
149      _heap_end = .;
150      . += _STACK_SIZE;
151      . = ALIGN(8);
152      _stack = .;
153      _end = .;
154   } > flatmem
155   .tdata : {  
156     *(.tdata)
157     *(.gnu.linkonce.td.*)
158   } > flatmem
159   .tbss : {  
160     *(.tbss)
161     *(.gnu.linkonce.tb.*)
162   } > flatmem
163 }