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