Debian Codegraph @

ldscripts/elf_i386.xB

raw
1 /* Linker script for normal executables with 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 text PT_LOAD FILEHDR PHDRS ;
15 data PT_LOAD ;
16 htlb PT_LOAD FLAGS (0x00100007);
17 dynamic PT_DYNAMIC ;
18 note PT_NOTE ;
19 gnu_stack PT_GNU_STACK ;
20 /* this is the value of PT_GNU_EH_FRAME as defined in
21 usr/include/elf.h but binutils does not recognize that identifier
22 as it does other PT_ constants. */
23 eh_frame_hdr 1685382480 FLAGS (0x00000004);
24 }
25 SECTIONS
26 {
27 /* Read-only sections, merged into text segment: */
28 __executable_start = 0x08048000; . = 0x08048000 + SIZEOF_HEADERS;
29 .interp : { *(.interp) } :text :interp
30 .note.SuSE : { *(.note.SuSE) } :text :note
31 .note.ABI-tag : { *(.note.ABI-tag) } :text :note
32 .note.gnu.build-id : { *(.note.gnu.build-id) } :text :note
33 .hash : { *(.hash) } :text
34 .dynsym : { *(.dynsym) }
35 .dynstr : { *(.dynstr) }
36 .gnu.version : { *(.gnu.version) }
37 .gnu.version_d : { *(.gnu.version_d) }
38 .gnu.version_r : { *(.gnu.version_r) }
39 .rel.init : { *(.rel.init) }
40 .rela.init : { *(.rela.init) }
41 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
42 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
43 .rel.fini : { *(.rel.fini) }
44 .rela.fini : { *(.rela.fini) }
45 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
46 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
47 .rel.data.rel.ro : { *(.rel.data.rel.ro*) }
48 .rela.data.rel.ro : { *(.rel.data.rel.ro*) }
49 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
50 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
51 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
52 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
53 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
54 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
55 .rel.ctors : { *(.rel.ctors) }
56 .rela.ctors : { *(.rela.ctors) }
57 .rel.dtors : { *(.rel.dtors) }
58 .rela.dtors : { *(.rela.dtors) }
59 .rel.got : { *(.rel.got) }
60 .rela.got : { *(.rela.got) }
61 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
62 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
63 .rel.plt : { *(.rel.plt) }
64 .rela.plt : { *(.rela.plt) }
65 .init :
66 {
67 KEEP (*(.init))
68 } =0x90909090
69 .plt : { *(.plt) }
70 .text :
71 {
72 *(.text .stub .text.* .gnu.linkonce.t.*)
73 KEEP (*(.text.*personality*))
74 /* .gnu.warning sections are handled specially by elf32.em. */
75 *(.gnu.warning)
76 } =0x90909090
77 .fini :
78 {
79 KEEP (*(.fini))
80 } =0x90909090
81 PROVIDE (__etext = .);
82 PROVIDE (_etext = .);
83 PROVIDE (etext = .);
84 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
85 .rodata1 : { *(.rodata1) }
86 .eh_frame_hdr : { *(.eh_frame_hdr) } :data :eh_frame_hdr
87 /* .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }
88 .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) } */
89 /* Adjust the address for the data segment. We want to adjust up to
90 the same address within the page on the next page up. */
91 . = ALIGN (0x1000) - ((0x1000 - .) & (0x1000 - 1)); . = DATA_SEGMENT_ALIGN (0x1000, 0x1000);
92 /* Exception handling */
93 .eh_frame : /* ONLY_IF_RW */ { KEEP (*(.eh_frame)) } :data
94 .gcc_except_table : /* ONLY_IF_RW */ { KEEP (*(.gcc_except_table)) *(.gcc_except_table.*) }
95 /* Thread Local Storage sections */
96 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
97 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
98 /* Ensure the __preinit_array_start label is properly aligned. We
99 could instead move the label definition inside the section, but
100 the linker would then create the section even if it turns out to
101 be empty, which isn't pretty. */
102 . = ALIGN(32 / 8);
103 PROVIDE (__preinit_array_start = .);
104 .preinit_array : { KEEP (*(.preinit_array)) }
105 PROVIDE (__preinit_array_end = .);
106 PROVIDE (__init_array_start = .);
107 .init_array : { KEEP (*(.init_array)) }
108 PROVIDE (__init_array_end = .);
109 PROVIDE (__fini_array_start = .);
110 .fini_array : { KEEP (*(.fini_array)) }
111 PROVIDE (__fini_array_end = .);
112 .ctors :
113 {
114 /* gcc uses crtbegin.o to find the start of
115 the constructors, so we make sure it is
116 first. Because this is a wildcard, it
117 doesn't matter if the user does not
118 actually link against crtbegin.o; the
119 linker won't look for a file to match a
120 wildcard. The wildcard also means that it
121 doesn't matter which directory crtbegin.o
122 is in. */
123 KEEP (*crtbegin*.o(.ctors))
124 /* We don't want to include the .ctor section from
125 from the crtend.o file until after the sorted ctors.
126 The .ctor section from the crtend file contains the
127 end of ctors marker and it must be last */
128 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
129 KEEP (*(SORT(.ctors.*)))
130 KEEP (*(.ctors))
131 }
132 .dtors :
133 {
134 KEEP (*crtbegin*.o(.dtors))
135 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
136 KEEP (*(SORT(.dtors.*)))
137 KEEP (*(.dtors))
138 }
139 .jcr : { KEEP (*(.jcr)) }
140 .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }
141 .dynamic : { *(.dynamic) } :dynamic :data
142 .got : { *(.got.plt) *(.got) }
143 /*. = DATA_SEGMENT_RELRO_END (12, .);*/
144 .data :
145 {
146 *(.data .data.* .gnu.linkonce.d.*)
147 KEEP (*(.gnu.linkonce.d.*personality*))
148 SORT(CONSTRUCTORS)
149 }
150 .data1 : { *(.data1) }
151 _edata = .;
152 PROVIDE (edata = .);
153 . = ALIGN(32 / 8);
154 . = DATA_SEGMENT_END (.);
155 /* Hugepage area */
156 . = ALIGN(0x1000000); /* Align to 16MB (4MB hugepage size, plus some slack in case of larger hugepages in future */
157 __bss_start = .;
158 .bss :
159 {
160 *(.dynbss)
161 *(.bss .bss.* .gnu.linkonce.b.*)
162 *(COMMON)
163 } :htlb
164 _end = .;
165 PROVIDE (end = .);
166 /* Stabs debugging sections. */
167 .stab 0 : { *(.stab) }
168 .stabstr 0 : { *(.stabstr) }
169 .stab.excl 0 : { *(.stab.excl) }
170 .stab.exclstr 0 : { *(.stab.exclstr) }
171 .stab.index 0 : { *(.stab.index) }
172 .stab.indexstr 0 : { *(.stab.indexstr) }
173 .comment 0 : { *(.comment) }
174 /* DWARF debug sections.
175 Symbols in the DWARF debugging sections are relative to the beginning
176 of the section so we begin them at 0. */
177 /* DWARF 1 */
178 .debug 0 : { *(.debug) }
179 .line 0 : { *(.line) }
180 /* GNU DWARF 1 extensions */
181 .debug_srcinfo 0 : { *(.debug_srcinfo) }
182 .debug_sfnames 0 : { *(.debug_sfnames) }
183 /* DWARF 1.1 and DWARF 2 */
184 .debug_aranges 0 : { *(.debug_aranges) }
185 .debug_pubnames 0 : { *(.debug_pubnames) }
186 /* DWARF 2 */
187 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
188 .debug_abbrev 0 : { *(.debug_abbrev) }
189 .debug_line 0 : { *(.debug_line) }
190 .debug_frame 0 : { *(.debug_frame) }
191 .debug_str 0 : { *(.debug_str) }
192 .debug_loc 0 : { *(.debug_loc) }
193 .debug_macinfo 0 : { *(.debug_macinfo) }
194 /* SGI/MIPS DWARF 2 extensions */
195 .debug_weaknames 0 : { *(.debug_weaknames) }
196 .debug_funcnames 0 : { *(.debug_funcnames) }
197 .debug_typenames 0 : { *(.debug_typenames) }
198 .debug_varnames 0 : { *(.debug_varnames) }
199 /DISCARD/ : { *(.note.GNU-stack) }
200 }