2 OUTPUT_FORMAT("elf64-x86-64-freebsd", "elf64-x86-64-freebsd", "elf64-x86-64-freebsd")
3 OUTPUT_ARCH(i386:x86-64)
5 SEARCH_DIR("/usr/lib");
8 /* Read-only sections, merged into text segment: */
9 kernphys = 0x200000; /* 2MB superpage size */
10 . = kernbase + kernphys + SIZEOF_HEADERS;
12 * Use the AT keyword in order to set the right LMA that contains
13 * the physical address where the section should be loaded. This is
14 * needed for the Xen loader which honours the LMA.
16 .interp : AT (kernphys + SIZEOF_HEADERS) { *(.interp) }
18 .gnu.hash : { *(.gnu.hash) }
19 .dynsym : { *(.dynsym) }
20 .dynstr : { *(.dynstr) }
21 .gnu.version : { *(.gnu.version) }
22 .gnu.version_d : { *(.gnu.version_d) }
23 .gnu.version_r : { *(.gnu.version_r) }
24 .rel.init : { *(.rel.init) }
25 .rela.init : { *(.rela.init) }
26 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
27 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
28 .rel.fini : { *(.rel.fini) }
29 .rela.fini : { *(.rela.fini) }
30 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
31 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
32 .rel.data.rel.ro : { *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*) }
33 .rela.data.rel.ro : { *(.rela.data.rel.ro* .rela.gnu.linkonce.d.rel.ro.*) }
34 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
35 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
36 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
37 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
38 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
39 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
40 .rel.ctors : { *(.rel.ctors) }
41 .rela.ctors : { *(.rela.ctors) }
42 .rel.dtors : { *(.rel.dtors) }
43 .rela.dtors : { *(.rela.dtors) }
44 .rel.got : { *(.rel.got) }
45 .rela.got : { *(.rela.got) }
46 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
47 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
48 .rel.ldata : { *(.rel.ldata .rel.ldata.* .rel.gnu.linkonce.l.*) }
49 .rela.ldata : { *(.rela.ldata .rela.ldata.* .rela.gnu.linkonce.l.*) }
50 .rel.lbss : { *(.rel.lbss .rel.lbss.* .rel.gnu.linkonce.lb.*) }
51 .rela.lbss : { *(.rela.lbss .rela.lbss.* .rela.gnu.linkonce.lb.*) }
52 .rel.lrodata : { *(.rel.lrodata .rel.lrodata.* .rel.gnu.linkonce.lr.*) }
53 .rela.lrodata : { *(.rela.lrodata .rela.lrodata.* .rela.gnu.linkonce.lr.*) }
54 .rel.plt : { *(.rel.plt) }
55 .rela.plt : { *(.rela.plt) }
63 *(.text .stub .text.* .gnu.linkonce.t.*)
64 KEEP (*(.text.*personality*))
65 /* .gnu.warning sections are handled specially by elf32.em. */
72 PROVIDE (__etext = .);
75 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
76 .rodata1 : { *(.rodata1) }
77 .note.gnu.build-id : {
78 PROVIDE (__build_id_start = .);
80 PROVIDE (__build_id_end = .);
82 .eh_frame_hdr : { *(.eh_frame_hdr) }
83 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
84 .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }
85 /* Adjust the address for the data segment. We want to adjust up to
86 the same address within the page on the next page up. */
87 . = ALIGN (CONSTANT (MAXPAGESIZE)) - ((CONSTANT (MAXPAGESIZE) - .) & (CONSTANT (MAXPAGESIZE) - 1)); . = DATA_SEGMENT_ALIGN (CONSTANT (MAXPAGESIZE), CONSTANT (COMMONPAGESIZE));
88 PROVIDE (brwsection = .);
89 /* Exception handling */
90 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) }
91 .gcc_except_table : ONLY_IF_RW { *(.gcc_except_table .gcc_except_table.*) }
92 /* Thread Local Storage sections */
93 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
94 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
97 PROVIDE_HIDDEN (__preinit_array_start = .);
98 KEEP (*(.preinit_array))
99 PROVIDE_HIDDEN (__preinit_array_end = .);
103 PROVIDE_HIDDEN (__init_array_start = .);
104 KEEP (*(SORT(.init_array.*)))
105 KEEP (*(.init_array))
106 PROVIDE_HIDDEN (__init_array_end = .);
110 PROVIDE_HIDDEN (__fini_array_start = .);
111 KEEP (*(.fini_array))
112 KEEP (*(SORT(.fini_array.*)))
113 PROVIDE_HIDDEN (__fini_array_end = .);
116 PROVIDE (start_ctors = .);
119 /* gcc uses crtbegin.o to find the start of
120 the constructors, so we make sure it is
121 first. Because this is a wildcard, it
122 doesn't matter if the user does not
123 actually link against crtbegin.o; the
124 linker won't look for a file to match a
125 wildcard. The wildcard also means that it
126 doesn't matter which directory crtbegin.o
128 KEEP (*crtbegin.o(.ctors))
129 KEEP (*crtbegin?.o(.ctors))
130 /* We don't want to include the .ctor section from
131 the crtend.o file until after the sorted ctors.
132 The .ctor section from the crtend file contains the
133 end of ctors marker and it must be last */
134 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
135 KEEP (*(SORT(.ctors.*)))
139 PROVIDE (stop_ctors = .);
142 KEEP (*crtbegin.o(.dtors))
143 KEEP (*crtbegin?.o(.dtors))
144 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
145 KEEP (*(SORT(.dtors.*)))
148 .jcr : { KEEP (*(.jcr)) }
149 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
150 .dynamic : { *(.dynamic) }
152 . = DATA_SEGMENT_RELRO_END (24, .);
153 .got.plt : { *(.got.plt) }
155 .data.read_frequently :
157 *(SORT_BY_ALIGNMENT(.data.read_frequently))
164 .data.exclusive_cache_line :
166 *(.data.exclusive_cache_line)
171 *(.data .data.* .gnu.linkonce.d.*)
172 KEEP (*(.gnu.linkonce.d.*personality*))
174 .data1 : { *(.data1) }
175 _edata = .; PROVIDE (edata = .);
180 *(.bss .bss.* .gnu.linkonce.b.*)
182 /* Align here to ensure that the .bss section occupies space up to
183 _end. Align after .bss to ensure correct alignment even if the
184 .bss section disappears because there are no input sections.
185 FIXME: Why do we need it? When there is no .bss section, we don't
186 pad the .data section. */
187 . = ALIGN(. != 0 ? 64 / 8 : 1);
192 *(.lbss .lbss.* .gnu.linkonce.lb.*)
196 .lrodata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
198 *(.lrodata .lrodata.* .gnu.linkonce.lr.*)
200 .ldata ALIGN(CONSTANT (MAXPAGESIZE)) + (. & (CONSTANT (MAXPAGESIZE) - 1)) :
202 *(.ldata .ldata.* .gnu.linkonce.l.*)
203 . = ALIGN(. != 0 ? 64 / 8 : 1);
206 _end = .; PROVIDE (end = .);
207 . = DATA_SEGMENT_END (.);
208 /* Stabs debugging sections. */
209 .stab 0 : { *(.stab) }
210 .stabstr 0 : { *(.stabstr) }
211 .stab.excl 0 : { *(.stab.excl) }
212 .stab.exclstr 0 : { *(.stab.exclstr) }
213 .stab.index 0 : { *(.stab.index) }
214 .stab.indexstr 0 : { *(.stab.indexstr) }
215 .comment 0 : { *(.comment) }
216 /* DWARF debug sections.
217 Symbols in the DWARF debugging sections are relative to the beginning
218 of the section so we begin them at 0. */
220 .debug 0 : { *(.debug) }
221 .line 0 : { *(.line) }
222 /* GNU DWARF 1 extensions */
223 .debug_srcinfo 0 : { *(.debug_srcinfo) }
224 .debug_sfnames 0 : { *(.debug_sfnames) }
225 /* DWARF 1.1 and DWARF 2 */
226 .debug_aranges 0 : { *(.debug_aranges) }
227 .debug_pubnames 0 : { *(.debug_pubnames) }
229 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
230 .debug_abbrev 0 : { *(.debug_abbrev) }
231 .debug_line 0 : { *(.debug_line) }
232 .debug_frame 0 : { *(.debug_frame) }
233 .debug_str 0 : { *(.debug_str) }
234 .debug_loc 0 : { *(.debug_loc) }
235 .debug_macinfo 0 : { *(.debug_macinfo) }
236 /* SGI/MIPS DWARF 2 extensions */
237 .debug_weaknames 0 : { *(.debug_weaknames) }
238 .debug_funcnames 0 : { *(.debug_funcnames) }
239 .debug_typenames 0 : { *(.debug_typenames) }
240 .debug_varnames 0 : { *(.debug_varnames) }
242 .debug_pubtypes 0 : { *(.debug_pubtypes) }
243 .debug_ranges 0 : { *(.debug_ranges) }
244 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
245 /DISCARD/ : { *(.note.GNU-stack) }