]> git.wh0rd.org - ICEs.git/blame - add-gnu-debuglink/linker.t
initial import
[ICEs.git] / add-gnu-debuglink / linker.t
CommitLineData
45516216 1/* Script for -z combreloc: combine and sort reloc sections */
2OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
3 "elf64-x86-64")
4OUTPUT_ARCH(i386:x86-64)
5ENTRY(_start)
6SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib64"); SEARCH_DIR("/usr/lib64/binutils/x86_64-pc-linux-gnu/2.17.50.0.1764"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/x86_64-pc-linux-gnu/lib"); SEARCH_DIR("/usr/lib64/binutils/x86_64-pc-linux-gnu/2.17.50.0.17"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
7SECTIONS
8{
9 /* Read-only sections, merged into text segment: */
10 PROVIDE (__executable_start = 0x400000); . = 0x400000 + SIZEOF_HEADERS;
11 .interp : { *(.interp) }
12 .hash : { *(.hash) }
13 .gnu.hash : { *(.gnu.hash) }
14 .dynsym : { *(.dynsym) }
15 .dynstr : { *(.dynstr) }
16 .gnu.version : { *(.gnu.version) }
17 .gnu.version_d : { *(.gnu.version_d) }
18 .gnu.version_r : { *(.gnu.version_r) }
19 .rel.dyn :
20 {
21 *(.rel.init)
22 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
23 *(.rel.fini)
24 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
25 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
26 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
27 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
28 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
29 *(.rel.ctors)
30 *(.rel.dtors)
31 *(.rel.got)
32 *(.rel.sharable_data .rel.sharable_data.* .rel.gnu.linkonce.shrd.*)
33 *(.rel.sharable_bss .rel.sharable_bss.* .rel.gnu.linkonce.shrb.*)
34 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
35 *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*)
36 *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*)
37 *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*)
38 }
39 .rela.dyn :
40 {
41 *(.rela.init)
42 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
43 *(.rela.fini)
44 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
45 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
46 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
47 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
48 *(.rela.ctors)
49 *(.rela.dtors)
50 *(.rela.got)
51 *(.rela.sharable_data .rela.sharable_data.* .rela.gnu.linkonce.shrd.*)
52 *(.rela.sharable_bss .rela.sharable_bss.* .rela.gnu.linkonce.shrb.*)
53 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
54 *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*)
55 *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*)
56 *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*)
57 }
58 .rel.plt : { *(.rel.plt) }
59 .rela.plt : { *(.rela.plt) }
60 .init :
61 {
62 KEEP (*(.init))
63 } =0x90909090
64 .plt : { *(.plt) }
65 .text :
66 {
67 *(.text .stub .text.* .gnu.linkonce.t.*)
68 KEEP (*(.text.*personality*))
69 /* .gnu.warning sections are handled specially by elf32.em. */
70 *(.gnu.warning)
71 } =0x90909090
72 .fini :
73 {
74 KEEP (*(.fini))
75 } =0x90909090
76 PROVIDE (__etext = .);
77 PROVIDE (_etext = .);
78 PROVIDE (etext = .);
79 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
80 .rodata1 : { *(.rodata1) }
81 .eh_frame_hdr : { *(.eh_frame_hdr) }
82 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
83 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
84 /* Adjust the address for the data segment. We want to adjust up to
85 the same address within the page on the next page up. */
86 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
87 /* Exception handling */
88 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
89 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
90 /* Thread Local Storage sections */
91 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
92 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
93 .preinit_array :
94 {
95 PROVIDE_HIDDEN (__preinit_array_start = .);
96 KEEP (*(.preinit_array))
97 PROVIDE_HIDDEN (__preinit_array_end = .);
98 }
99 .init_array :
100 {
101 PROVIDE_HIDDEN (__init_array_start = .);
102 KEEP (*(SORT(.init_array.*)))
103 KEEP (*(.init_array))
104 PROVIDE_HIDDEN (__init_array_end = .);
105 }
106 .fini_array :
107 {
108 PROVIDE_HIDDEN (__fini_array_start = .);
109 KEEP (*(.fini_array))
110 KEEP (*(SORT(.fini_array.*)))
111 PROVIDE_HIDDEN (__fini_array_end = .);
112 }
113 .ctors :
114 {
115 /* gcc uses crtbegin.o to find the start of
116 the constructors, so we make sure it is
117 first. Because this is a wildcard, it
118 doesn't matter if the user does not
119 actually link against crtbegin.o; the
120 linker won't look for a file to match a
121 wildcard. The wildcard also means that it
122 doesn't matter which directory crtbegin.o
123 is in. */
124 KEEP (*crtbegin.o(.ctors))
125 KEEP (*crtbegin?.o(.ctors))
126 /* We don't want to include the .ctor section from
127 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 *crtend?.o ) .ctors))
131 KEEP (*(SORT(.ctors.*)))
132 KEEP (*(.ctors))
133 }
134 .dtors :
135 {
136 KEEP (*crtbegin.o(.dtors))
137 KEEP (*crtbegin?.o(.dtors))
138 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
139 KEEP (*(SORT(.dtors.*)))
140 KEEP (*(.dtors))
141 }
142 .jcr : { KEEP (*(.jcr)) }
143 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
144 .dynamic : { *(.dynamic) }
145 .got : { *(.got) }
146 . = DATA_SEGMENT_RELRO_END (24, .);
147 .got.plt : { *(.got.plt) }
148 .data :
149 {
150 *(.data .data.* .gnu.linkonce.d.*)
151 KEEP (*(.gnu.linkonce.d.*personality*))
152 SORT(CONSTRUCTORS)
153 }
154 .data1 : { *(.data1) }
155 /* Sharable data sections. */
156 .sharable_data : ALIGN(CONSTANT (MAXPAGESIZE))
157 {
158 PROVIDE_HIDDEN (__sharable_data_start = .);
159 *(.sharable_data .sharable_data.* .gnu.linkonce.shrd.*)
160 /* Align here to ensure that the sharable data section ends at the
161 page boundary. */
162 . = ALIGN(. != 0 ? CONSTANT (MAXPAGESIZE) : 1);
163 PROVIDE_HIDDEN (__sharable_data_end = .);
164 }
165 _edata = .; PROVIDE (edata = .);
166 __bss_start = .;
167 .bss :
168 {
169 *(.dynbss)
170 *(.bss .bss.* .gnu.linkonce.b.*)
171 *(COMMON)
172 /* Align here to ensure that the .bss section occupies space up to
173 _end. Align after .bss to ensure correct alignment even if the
174 .bss section disappears because there are no input sections.
175 FIXME: Why do we need it? When there is no .bss section, we don't
176 pad the .data section. */
177 . = ALIGN(. != 0 ? 64 / 8 : 1);
178 }
179 .lbss :
180 {
181 *(.dynlbss)
182 *(.lbss .lbss.* .gnu.linkonce.lb.*)
183 *(LARGE_COMMON)
184 }
185 /* Sharable bss sections */
186 .sharable_bss : ALIGN(CONSTANT (MAXPAGESIZE))
187 {
188 PROVIDE_HIDDEN (__sharable_bss_start = .);
189 *(.dynsharablebss)
190 *(.sharable_bss .sharable_bss.* .gnu.linkonce.shrb.*)
191 *(SHARABLE_COMMON)
192 /* Align here to ensure that the sharable bss section ends at the
193 page boundary. */
194 . = ALIGN(. != 0 ? CONSTANT (MAXPAGESIZE) : 1);
195 PROVIDE_HIDDEN (__sharable_bss_end = .);
196 }
197 . = ALIGN(64 / 8);
198 .lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
199 {
200 *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
201 }
202 .ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
203 {
204 *(.ldata .ldata.* .gnu.linkonce.l.*)
205 . = ALIGN(. != 0 ? 64 / 8 : 1);
206 }
207 . = ALIGN(64 / 8);
208 _end = .; PROVIDE (end = .);
209 . = DATA_SEGMENT_END (.);
210 /* Stabs debugging sections. */
211 .stab 0 : { *(.stab) }
212 .stabstr 0 : { *(.stabstr) }
213 .stab.excl 0 : { *(.stab.excl) }
214 .stab.exclstr 0 : { *(.stab.exclstr) }
215 .stab.index 0 : { *(.stab.index) }
216 .stab.indexstr 0 : { *(.stab.indexstr) }
217 .comment 0 : { *(.comment) }
218 /* DWARF debug sections.
219 Symbols in the DWARF debugging sections are relative to the beginning
220 of the section so we begin them at 0. */
221 /* DWARF 1 */
222 .debug 0 : { *(.debug) }
223 .line 0 : { *(.line) }
224 /* GNU DWARF 1 extensions */
225 .debug_srcinfo 0 : { *(.debug_srcinfo) }
226 .debug_sfnames 0 : { *(.debug_sfnames) }
227 /* DWARF 1.1 and DWARF 2 */
228 .debug_aranges 0 : { *(.debug_aranges) }
229 .debug_pubnames 0 : { *(.debug_pubnames) }
230 /* DWARF 2 */
231 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
232 .debug_abbrev 0 : { *(.debug_abbrev) }
233 .debug_line 0 : { *(.debug_line) }
234 .debug_frame 0 : { *(.debug_frame) }
235 .debug_str 0 : { *(.debug_str) }
236 .debug_loc 0 : { *(.debug_loc) }
237 .debug_macinfo 0 : { *(.debug_macinfo) }
238 /* SGI/MIPS DWARF 2 extensions */
239 .debug_weaknames 0 : { *(.debug_weaknames) }
240 .debug_funcnames 0 : { *(.debug_funcnames) }
241 .debug_typenames 0 : { *(.debug_typenames) }
242 .debug_varnames 0 : { *(.debug_varnames) }
243 /* DWARF 3 */
244 .debug_pubtypes 0 : { *(.debug_pubtypes) }
245 .debug_ranges 0 : { *(.debug_ranges) }
246 /DISCARD/ : { *(.note.GNU-stack) }
247 /DISCARD/ : { *(.gnu_debuglink) }
248}