Debian Codegraph @

ldscripts/elf_i386.xBDT

raw
1 /* Linker script for normal executables with text, data and BSS in hugepages */
2 OUTPUT_FORMAT("elf32-i386", "elf32-i386",
3 "elf32-i386")
4 OUTPUT_ARCH(i386)
5 ENTRY(_start)
6 SEARCH_DIR("/usr/i486-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
7 INPUT(-lhugetlbfs);
8 /* Do we need any of these for elf?
9 __DYNAMIC = 0; */
10 PHDRS
11 {
12 headers PT_PHDR PHDRS ;
13 interp PT_INTERP ;
14 htext PT_LOAD FILEHDR PHDRS FLAGS (0x00100005);
15 hdata PT_LOAD FLAGS (0x00100007);
16 dynamic PT_DYNAMIC ;
17 note PT_NOTE ;
18 gnu_stack PT_GNU_STACK ;
19 /* this is the value of PT_GNU_EH_FRAME as defined in
20 usr/include/elf.h but binutils does not recognize that identifier
21 as it does other PT_ constants. */
22 eh_frame_hdr 1685382480 FLAGS (0x00000004);
23 }
24 SECTIONS
25 {
26 /* Read-only sections, merged into text segment: */
27 /* Different from the normal origin addres, because we need to make
28 * it hugepage aligned */
29 __executable_start = 0x08000000; . = 0x08000000 + SIZEOF_HEADERS;
30 .interp : { *(.interp) } :htext :interp
31 .note.SuSE : { *(.note.SuSE) } :htext :note
32 .note.ABI-tag : { *(.note.ABI-tag) } :htext :note
33 .note.gnu.build-id : { *(.note.gnu.build-id) } :htext :note
34 .hash : { *(.hash) } :htext
35 .dynsym : { *(.dynsym) } :htext
36 .dynstr : { *(.dynstr) } :htext
37 .gnu.version : { *(.gnu.version) } :htext
38 .gnu.version_d : { *(.gnu.version_d) } :htext
39 .gnu.version_r : { *(.gnu.version_r) } :htext
40 .rel.init : { *(.rel.init) } :htext
41 .rela.init : { *(.rela.init) } :htext
42 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) } :htext
43 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) } :htext
44 .rel.fini : { *(.rel.fini) } :htext
45 .rela.fini : { *(.rela.fini) } :htext
46 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) } :htext
47 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) } :htext
48 .rel.data.rel.ro : { *(.rel.data.rel.ro*) } :htext
49 .rela.data.rel.ro : { *(.rel.data.rel.ro*) } :htext
50 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) } :htext
51 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) } :htext
52 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) } :htext
53 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) } :htext
54 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) } :htext
55 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) } :htext
56 .rel.ctors : { *(.rel.ctors) } :htext
57 .rela.ctors : { *(.rela.ctors) } :htext
58 .rel.dtors : { *(.rel.dtors) } :htext
59 .rela.dtors : { *(.rela.dtors) } :htext
60 .rel.got : { *(.rel.got) } :htext
61 .rela.got : { *(.rela.got) } :htext
62 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) } :htext
63 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) } :htext
64 .rel.plt : { *(.rel.plt) } :htext
65 .rela.plt : { *(.rela.plt) } :htext
66 .init :
67 {
68 KEEP (*(.init))
69 } :htext =0x90909090
70 .plt : { *(.plt) }
71 .text :
72 {
73 *(.text .stub .text.* .gnu.linkonce.t.*)
74 KEEP (*(.text.*personality*))
75 /* .gnu.warning sections are handled specially by elf32.em. */
76 *(.gnu.warning)
77 } :htext =0x90909090
78 .fini :
79 {
80 KEEP (*(.fini))
81 } :htext =0x90909090
82 PROVIDE (__etext = .);
83 PROVIDE (_etext = .);
84 PROVIDE (etext = .);
85 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } :htext
86 .rodata1 : { *(.rodata1) } :htext
87 .eh_frame_hdr : { *(.eh_frame_hdr) } :htext :eh_frame_hdr
88 /* .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } :htext
89 .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } :htext */
90
91 /* We don't maintain address congruence here, because saving
92 * hugepages is more important than saving executable size. */
93 . = ALIGN (0x1000000); /* Align to 16MB (4MB hugepage size, plus some slack in case of larger hugepages in future */
94 /* Exception handling */
95 .eh_frame : /* ONLY_IF_RW */ { KEEP (*(.eh_frame)) } :hdata
96 .gcc_except_table : /* ONLY_IF_RW */ { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } :hdata
97 /* Thread Local Storage sections */
98 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } :hdata
99 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } :hdata
100 /* Ensure the __preinit_array_start label is properly aligned. We
101 could instead move the label definition inside the section, but
102 the linker would then create the section even if it turns out to
103 be empty, which isn't pretty. */
104 . = ALIGN(32 / 8);
105 PROVIDE (__preinit_array_start = .);
106 .preinit_array : { KEEP (*(.preinit_array)) } :hdata
107 PROVIDE (__preinit_array_end = .);
108 PROVIDE (__init_array_start = .);
109 .init_array : { KEEP (*(.init_array)) } :hdata
110 PROVIDE (__init_array_end = .);
111 PROVIDE (__fini_array_start = .);
112 .fini_array : { KEEP (*(.fini_array)) } :hdata
113 PROVIDE (__fini_array_end = .);
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 } :hdata
134 .dtors :
135 {
136 KEEP (*crtbegin*.o(.dtors))
137 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
138 KEEP (*(SORT(.dtors.*)))
139 KEEP (*(.dtors))
140 } :hdata
141 .jcr : { KEEP (*(.jcr)) } :hdata
142 .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } :hdata
143 .dynamic : { *(.dynamic) } :dynamic :hdata
144 .got : { *(.got.plt) *(.got) } :hdata
145 .data :
146 {
147 *(.data .data.* .gnu.linkonce.d.*)
148 KEEP (*(.gnu.linkonce.d.*personality*))
149 SORT(CONSTRUCTORS)
150 } :hdata
151 .data1 : { *(.data1) } :hdata
152 _edata = .;
153 PROVIDE (edata = .);
154 . = ALIGN(32 / 8);
155 __bss_start = .;
156 .bss :
157 {
158 *(.dynbss)
159 *(.bss .bss.* .gnu.linkonce.b.*)
160 *(COMMON)
161 } :hdata
162 _end = .;
163 PROVIDE (end = .);
164 /* Stabs debugging sections. */
165 .stab 0 : { *(.stab) }
166 .stabstr 0 : { *(.stabstr) }
167 .stab.excl 0 : { *(.stab.excl) }
168 .stab.exclstr 0 : { *(.stab.exclstr) }
169 .stab.index 0 : { *(.stab.index) }
170 .stab.indexstr 0 : { *(.stab.indexstr) }
171 .comment 0 : { *(.comment) }
172 /* DWARF debug sections.
173 Symbols in the DWARF debugging sections are relative to the beginning
174 of the section so we begin them at 0. */
175 /* DWARF 1 */
176 .debug 0 : { *(.debug) }
177 .line 0 : { *(.line) }
178 /* GNU DWARF 1 extensions */
179 .debug_srcinfo 0 : { *(.debug_srcinfo) }
180 .debug_sfnames 0 : { *(.debug_sfnames) }
181 /* DWARF 1.1 and DWARF 2 */
182 .debug_aranges 0 : { *(.debug_aranges) }
183 .debug_pubnames 0 : { *(.debug_pubnames) }
184 /* DWARF 2 */
185 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
186 .debug_abbrev 0 : { *(.debug_abbrev) }
187 .debug_line 0 : { *(.debug_line) }
188 .debug_frame 0 : { *(.debug_frame) }
189 .debug_str 0 : { *(.debug_str) }
190 .debug_loc 0 : { *(.debug_loc) }
191 .debug_macinfo 0 : { *(.debug_macinfo) }
192 /* SGI/MIPS DWARF 2 extensions */
193 .debug_weaknames 0 : { *(.debug_weaknames) }
194 .debug_funcnames 0 : { *(.debug_funcnames) }
195 .debug_typenames 0 : { *(.debug_typenames) }
196 .debug_varnames 0 : { *(.debug_varnames) }
197 /DISCARD/ : { *(.note.GNU-stack) }
198 }