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