2 * Linker script for ELF dynamic loaded modules.
3 * This simply mirrors the 32bit linker script with minimal x86_64 changes
6 /* Script for --shared -z combreloc: shared library, combine & sort relocs */
7 OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
8 OUTPUT_ARCH(i386:x86-64)
11 /* Read-only sections, merged into text segment: */
12 . = 0 + SIZEOF_HEADERS;
13 .note.gnu.build-id : { *(.note.gnu.build-id) }
15 .gnu.hash : { *(.gnu.hash) }
16 .dynsym : { *(.dynsym) }
17 .dynstr : { *(.dynstr) }
18 .gnu.version : { *(.gnu.version) }
19 .gnu.version_d : { *(.gnu.version_d) }
20 .gnu.version_r : { *(.gnu.version_r) }
21 /* mouli: introduce alignment for various segments */
25 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
27 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
28 *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
29 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
30 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
31 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
35 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
40 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
42 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
43 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
44 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
45 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
49 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
51 .rel.plt : { *(.rel.plt); }
52 .rela.plt : { *(.rela.plt) }
60 *(.text .stub .text.* .gnu.linkonce.t.*)
61 KEEP (*(.text.*personality*))
62 /* .gnu.warning sections are handled specially by elf32.em. */
69 PROVIDE (__etext = .);
72 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
73 .rodata1 : { *(.rodata1) }
77 KEEP (*(.preinit_array))
82 KEEP (*(SORT(.ctors.*)))
84 KEEP (*(.ctors_modinit))
85 KEEP (*(.ctors_modmain))
86 KEEP (*(SORT(.init_array.*)))
94 KEEP (*(SORT(.dtors.*)))
96 KEEP (*(.dtors_modexit))
98 KEEP (*(SORT(.fini_array.*)))
102 .jcr : { KEEP (*(.jcr)) }
103 .data.rel.ro : { *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro* .gnu.linkonce.d.rel.ro.*) }
104 .dynamic : { *(.dynamic) }
106 /*. = DATA_SEGMENT_RELRO_END (12, .); -> This gives a "invalid assignment to location counter" error */
107 .got.plt : { *(.got.plt) }
110 *(.data .data.* .gnu.linkonce.d.*)
111 KEEP (*(.gnu.linkonce.d.*personality*))
114 .data1 : { *(.data1) }
116 PROVIDE (_edata = .);
120 *(.bss .bss.* .gnu.linkonce.b.*)
122 /* Align here to ensure that the .bss section occupies space up to
123 _end. Align after .bss to ensure correct alignment even if the
124 .bss section disappears because there are no input sections.
125 FIXME: Why do we need it? When there is no .bss section, we don't
126 pad the .data section. */
127 /*. = ALIGN(. != 0 ? 32 / 8 : 1);*/
128 . = ALIGN(. != 0 ? 64 / 8 : 1);
134 /*. = DATA_SEGMENT_END (.); -> This gives a "invalid assignment to location counter" error */
135 /* Stabs debugging sections. */
136 .stab 0 : { *(.stab) }
137 .stabstr 0 : { *(.stabstr) }
138 .stab.excl 0 : { *(.stab.excl) }
139 .stab.exclstr 0 : { *(.stab.exclstr) }
140 .stab.index 0 : { *(.stab.index) }
141 .stab.indexstr 0 : { *(.stab.indexstr) }
142 .comment 0 : { *(.comment) }
143 /* DWARF debug sections.
144 Symbols in the DWARF debugging sections are relative to the beginning
145 of the section so we begin them at 0. */
147 .debug 0 : { *(.debug) }
148 .line 0 : { *(.line) }
149 /* GNU DWARF 1 extensions */
150 .debug_srcinfo 0 : { *(.debug_srcinfo) }
151 .debug_sfnames 0 : { *(.debug_sfnames) }
152 /* DWARF 1.1 and DWARF 2 */
153 .debug_aranges 0 : { *(.debug_aranges) }
154 .debug_pubnames 0 : { *(.debug_pubnames) }
156 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
157 .debug_abbrev 0 : { *(.debug_abbrev) }
158 .debug_line 0 : { *(.debug_line) }
159 .debug_frame 0 : { *(.debug_frame) }
160 .debug_str 0 : { *(.debug_str) }
161 .debug_loc 0 : { *(.debug_loc) }
162 .debug_macinfo 0 : { *(.debug_macinfo) }
163 /* SGI/MIPS DWARF 2 extensions */
164 .debug_weaknames 0 : { *(.debug_weaknames) }
165 .debug_funcnames 0 : { *(.debug_funcnames) }
166 .debug_typenames 0 : { *(.debug_typenames) }
167 .debug_varnames 0 : { *(.debug_varnames) }
169 .debug_pubtypes 0 : { *(.debug_pubtypes) }
170 .debug_ranges 0 : { *(.debug_ranges) }
171 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
172 /DISCARD/ : { *(.eh_frame) }