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