|
1 /* Default linker script, for normal executables */ |
|
2 OUTPUT_FORMAT("elf64-ia64-little", "elf64-ia64-little", |
|
3 "elf64-ia64-little") |
|
4 OUTPUT_ARCH(ia64) |
|
5 ENTRY(_start) |
|
6 SEARCH_DIR("/usr/ia64-linux/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); |
|
7 /* Do we need any of these for elf? |
|
8 __DYNAMIC = 0; */ |
|
9 SECTIONS |
|
10 { |
|
11 /* Reserve a chunk of memory at a low address to prevent the host ld.so |
|
12 loading shared libraries where we want to put the target application. */ |
|
13 . = 0x10000; |
|
14 .reserved : { *(.reserved) } |
|
15 /* Read-only sections, merged into text segment: */ |
|
16 /* Older linkers can't add an extra program header for .reserved when |
|
17 SIZEOF_HEADERS is user. Instead leave a chunk of space for them. */ |
|
18 PROVIDE (__executable_start = 0x60000000); |
|
19 . = 0x60000000 + 0x10000 /*SIZEOF_HEADERS*/; |
|
20 .interp : { *(.interp) } |
|
21 .hash : { *(.hash) } |
|
22 .dynsym : { *(.dynsym) } |
|
23 .dynstr : { *(.dynstr) } |
|
24 .gnu.version : { *(.gnu.version) } |
|
25 .gnu.version_d : { *(.gnu.version_d) } |
|
26 .gnu.version_r : { *(.gnu.version_r) } |
|
27 .rel.init : { *(.rel.init) } |
|
28 .rela.init : { *(.rela.init) } |
|
29 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } |
|
30 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } |
|
31 .rel.fini : { *(.rel.fini) } |
|
32 .rela.fini : { *(.rela.fini) } |
|
33 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } |
|
34 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } |
|
35 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } |
|
36 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } |
|
37 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } |
|
38 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } |
|
39 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } |
|
40 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } |
|
41 .rel.ctors : { *(.rel.ctors) } |
|
42 .rela.ctors : { *(.rela.ctors) } |
|
43 .rel.dtors : { *(.rel.dtors) } |
|
44 .rela.dtors : { *(.rela.dtors) } |
|
45 .rel.got : { *(.rel.got) } |
|
46 .rela.got : { *(.rela.got) } |
|
47 .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) } |
|
48 .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) } |
|
49 .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) } |
|
50 .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) } |
|
51 .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) } |
|
52 .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) } |
|
53 .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) } |
|
54 .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) } |
|
55 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } |
|
56 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } |
|
57 .rel.plt : { *(.rel.plt) } |
|
58 .rela.plt : { *(.rela.plt) } |
|
59 .rela.IA_64.pltoff : { *(.rela.IA_64.pltoff) } |
|
60 .init : |
|
61 { |
|
62 KEEP (*(.init)) |
|
63 } =0x00300000010070000002000001000400 |
|
64 .plt : { *(.plt) } |
|
65 .text : |
|
66 { |
|
67 *(.text .stub .text.* .gnu.linkonce.t.*) |
|
68 /* .gnu.warning sections are handled specially by elf32.em. */ |
|
69 *(.gnu.warning) |
|
70 } =0x00300000010070000002000001000400 |
|
71 .fini : |
|
72 { |
|
73 KEEP (*(.fini)) |
|
74 } =0x00300000010070000002000001000400 |
|
75 PROVIDE (__etext = .); |
|
76 PROVIDE (_etext = .); |
|
77 PROVIDE (etext = .); |
|
78 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } |
|
79 .rodata1 : { *(.rodata1) } |
|
80 .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } |
|
81 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } |
|
82 .opd : { *(.opd) } |
|
83 .IA_64.unwind_info : { *(.IA_64.unwind_info* .gnu.linkonce.ia64unwi.*) } |
|
84 .IA_64.unwind : { *(.IA_64.unwind* .gnu.linkonce.ia64unw.*) } |
|
85 .eh_frame_hdr : { *(.eh_frame_hdr) } |
|
86 /* Adjust the address for the data segment. We want to adjust up to |
|
87 the same address within the page on the next page up. */ |
|
88 . = ALIGN(0x10000) + (. & (0x10000 - 1)); |
|
89 /* Ensure the __preinit_array_start label is properly aligned. We |
|
90 could instead move the label definition inside the section, but |
|
91 the linker would then create the section even if it turns out to |
|
92 be empty, which isn't pretty. */ |
|
93 . = ALIGN(64 / 8); |
|
94 PROVIDE (__preinit_array_start = .); |
|
95 .preinit_array : { *(.preinit_array) } |
|
96 PROVIDE (__preinit_array_end = .); |
|
97 PROVIDE (__init_array_start = .); |
|
98 .init_array : { *(.init_array) } |
|
99 PROVIDE (__init_array_end = .); |
|
100 PROVIDE (__fini_array_start = .); |
|
101 .fini_array : { *(.fini_array) } |
|
102 PROVIDE (__fini_array_end = .); |
|
103 .data : |
|
104 { |
|
105 *(.data .data.* .gnu.linkonce.d.*) |
|
106 SORT(CONSTRUCTORS) |
|
107 } |
|
108 .data1 : { *(.data1) } |
|
109 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } |
|
110 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } |
|
111 .eh_frame : { KEEP (*(.eh_frame)) } |
|
112 .gcc_except_table : { *(.gcc_except_table) } |
|
113 .dynamic : { *(.dynamic) } |
|
114 .ctors : |
|
115 { |
|
116 /* gcc uses crtbegin.o to find the start of |
|
117 the constructors, so we make sure it is |
|
118 first. Because this is a wildcard, it |
|
119 doesn't matter if the user does not |
|
120 actually link against crtbegin.o; the |
|
121 linker won't look for a file to match a |
|
122 wildcard. The wildcard also means that it |
|
123 doesn't matter which directory crtbegin.o |
|
124 is in. */ |
|
125 KEEP (*crtbegin*.o(.ctors)) |
|
126 /* We don't want to include the .ctor section from |
|
127 from the crtend.o file until after the sorted ctors. |
|
128 The .ctor section from the crtend file contains the |
|
129 end of ctors marker and it must be last */ |
|
130 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) |
|
131 KEEP (*(SORT(.ctors.*))) |
|
132 KEEP (*(.ctors)) |
|
133 } |
|
134 .dtors : |
|
135 { |
|
136 KEEP (*crtbegin*.o(.dtors)) |
|
137 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) |
|
138 KEEP (*(SORT(.dtors.*))) |
|
139 KEEP (*(.dtors)) |
|
140 } |
|
141 .jcr : { KEEP (*(.jcr)) } |
|
142 /* Ensure __gp is outside the range of any normal data. We need to |
|
143 do this to avoid the linker optimizing the code in op.o and getting |
|
144 it out of sync with the relocs that we read when processing that |
|
145 file. A better solution might be to ensure that the dynamically |
|
146 generated code and static qemu code share a single gp-value. */ |
|
147 __gp = . + 0x200000; |
|
148 .got : { *(.got.plt) *(.got) } |
|
149 .IA_64.pltoff : { *(.IA_64.pltoff) } |
|
150 /* We want the small data sections together, so single-instruction offsets |
|
151 can access them all, and initialized data all before uninitialized, so |
|
152 we can shorten the on-disk segment size. */ |
|
153 .sdata : |
|
154 { |
|
155 *(.sdata .sdata.* .gnu.linkonce.s.*) |
|
156 } |
|
157 _edata = .; |
|
158 PROVIDE (edata = .); |
|
159 __bss_start = .; |
|
160 .sbss : |
|
161 { |
|
162 PROVIDE (__sbss_start = .); |
|
163 PROVIDE (___sbss_start = .); |
|
164 *(.dynsbss) |
|
165 *(.sbss .sbss.* .gnu.linkonce.sb.*) |
|
166 *(.scommon) |
|
167 PROVIDE (__sbss_end = .); |
|
168 PROVIDE (___sbss_end = .); |
|
169 } |
|
170 .bss : |
|
171 { |
|
172 . += 0x400000; /* ensure .bss stuff is out of reach of gp */ |
|
173 *(.dynbss) |
|
174 *(.bss .bss.* .gnu.linkonce.b.*) |
|
175 *(COMMON) |
|
176 /* Align here to ensure that the .bss section occupies space up to |
|
177 _end. Align after .bss to ensure correct alignment even if the |
|
178 .bss section disappears because there are no input sections. */ |
|
179 . = ALIGN(64 / 8); |
|
180 } |
|
181 . = ALIGN(64 / 8); |
|
182 _end = .; |
|
183 PROVIDE (end = .); |
|
184 /* Stabs debugging sections. */ |
|
185 .stab 0 : { *(.stab) } |
|
186 .stabstr 0 : { *(.stabstr) } |
|
187 .stab.excl 0 : { *(.stab.excl) } |
|
188 .stab.exclstr 0 : { *(.stab.exclstr) } |
|
189 .stab.index 0 : { *(.stab.index) } |
|
190 .stab.indexstr 0 : { *(.stab.indexstr) } |
|
191 .comment 0 : { *(.comment) } |
|
192 /* DWARF debug sections. |
|
193 Symbols in the DWARF debugging sections are relative to the beginning |
|
194 of the section so we begin them at 0. */ |
|
195 /* DWARF 1 */ |
|
196 .debug 0 : { *(.debug) } |
|
197 .line 0 : { *(.line) } |
|
198 /* GNU DWARF 1 extensions */ |
|
199 .debug_srcinfo 0 : { *(.debug_srcinfo) } |
|
200 .debug_sfnames 0 : { *(.debug_sfnames) } |
|
201 /* DWARF 1.1 and DWARF 2 */ |
|
202 .debug_aranges 0 : { *(.debug_aranges) } |
|
203 .debug_pubnames 0 : { *(.debug_pubnames) } |
|
204 /* DWARF 2 */ |
|
205 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
|
206 .debug_abbrev 0 : { *(.debug_abbrev) } |
|
207 .debug_line 0 : { *(.debug_line) } |
|
208 .debug_frame 0 : { *(.debug_frame) } |
|
209 .debug_str 0 : { *(.debug_str) } |
|
210 .debug_loc 0 : { *(.debug_loc) } |
|
211 .debug_macinfo 0 : { *(.debug_macinfo) } |
|
212 /* SGI/MIPS DWARF 2 extensions */ |
|
213 .debug_weaknames 0 : { *(.debug_weaknames) } |
|
214 .debug_funcnames 0 : { *(.debug_funcnames) } |
|
215 .debug_typenames 0 : { *(.debug_typenames) } |
|
216 .debug_varnames 0 : { *(.debug_varnames) } |
|
217 /DISCARD/ : { *(.note.GNU-stack) } |
|
218 } |