Debian Codegraph @

ldscripts/elf64ppc.xB

raw
1 /* Linker script for normal executables with BSS in hugepages */
2 OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc",
3 "elf64-powerpc")
4 OUTPUT_ARCH(powerpc:common64)
5 ENTRY(_start)
6 SEARCH_DIR("/usr/powerpc64-linux-gnu/lib64"); SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); SEARCH_DIR("/usr/powerpc64-linux-gnu/lib"); SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib");
7 INPUT(-lhugetlbfs);
8 PHDRS
9 {
10 headers PT_PHDR PHDRS ;
11 interp PT_INTERP ;
12 text PT_LOAD FILEHDR PHDRS ;
13 data PT_LOAD ;
14 htlb PT_LOAD FLAGS (0x00100007);
15 dynamic PT_DYNAMIC ;
16 note PT_NOTE ;
17 /* this is the value of PT_GNU_EH_FRAME as defined in
18 usr/include/elf.h but binutils does not recognize that identifier
19 as it does other PT_ constants. */
20 eh_frame_hdr 1685382480 FLAGS (0x00000004);
21 }
22 SECTIONS
23 {
24 /* Read-only sections, merged into text segment: */
25 __executable_start = 0x10000000; . = 0x10000000 + SIZEOF_HEADERS;
26 .interp : { *(.interp) } :text :interp
27 .note.SuSE : { *(.note.SuSE) } :text :note
28 .note.ABI-tag : { *(.note.ABI-tag) } :text :note
29 .note.gnu.build-id : { *(.note.gnu.build-id) } :text :note
30 .hash : { *(.hash) } :text
31 .dynsym : { *(.dynsym) }
32 .dynstr : { *(.dynstr) }
33 .gnu.version : { *(.gnu.version) }
34 .gnu.version_d : { *(.gnu.version_d) }
35 .gnu.version_r : { *(.gnu.version_r) }
36 .rel.init : { *(.rel.init) }
37 .rela.init : { *(.rela.init) }
38 .rel.text : { *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) }
39 .rela.text : { *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) }
40 .rel.fini : { *(.rel.fini) }
41 .rela.fini : { *(.rela.fini) }
42 .rel.rodata : { *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) }
43 .rela.rodata : { *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) }
44 .rel.data.rel.ro : { *(.rel.data.rel.ro*) }
45 .rela.data.rel.ro : { *(.rel.data.rel.ro*) }
46 .rel.data : { *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) }
47 .rela.data : { *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) }
48 .rel.tdata : { *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) }
49 .rela.tdata : { *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) }
50 .rel.tbss : { *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) }
51 .rela.tbss : { *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) }
52 .rel.ctors : { *(.rel.ctors) }
53 .rela.ctors : { *(.rela.ctors) }
54 .rel.dtors : { *(.rel.dtors) }
55 .rela.dtors : { *(.rela.dtors) }
56 .rel.got : { *(.rel.got) }
57 .rela.got : { *(.rela.got) }
58 .rela.toc : { *(.rela.toc) }
59 .rel.sdata : { *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) }
60 .rela.sdata : { *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) }
61 .rel.sbss : { *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) }
62 .rela.sbss : { *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) }
63 .rel.sdata2 : { *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) }
64 .rela.sdata2 : { *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) }
65 .rel.sbss2 : { *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) }
66 .rela.sbss2 : { *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) }
67 .rel.bss : { *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) }
68 .rela.bss : { *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) }
69 .rel.plt : { *(.rel.plt) }
70 .rela.plt : { *(.rela.plt) }
71 .rela.tocbss : { *(.rela.tocbss) }
72 .init :
73 {
74 KEEP (*(.init))
75 } =0x60000000
76 .text :
77 {
78 *(.text .stub .text.* .gnu.linkonce.t.*)
79 KEEP (*(.text.*personality*))
80 /* .gnu.warning sections are handled specially by elf32.em. */
81 *(.gnu.warning)
82 *(.sfpr .glink)
83 } =0x60000000
84 .fini :
85 {
86 KEEP (*(.fini))
87 } =0x60000000
88 PROVIDE (__etext = .);
89 PROVIDE (_etext = .);
90 PROVIDE (etext = .);
91 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) }
92 .rodata1 : { *(.rodata1) }
93 .sdata2 :
94 {
95 *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
96 }
97 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) }
98 .eh_frame_hdr : { *(.eh_frame_hdr) } :text :eh_frame_hdr
99 /* .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) }*/
100 /* .gcc_except_table : ONLY_IF_RO { *(.gcc_except_table .gcc_except_table.*) }*/
101 /* Adjust the address for the data segment. We want to adjust up to
102 the same address within the page on the next page up. */
103 . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN (0x10000, 0x1000);
104 /* Exception handling */
105 .eh_frame : /*ONLY_IF_RW*/ { KEEP (*(.eh_frame)) } :data
106 .gcc_except_table : /*ONLY_IF_RW*/ { *(.gcc_except_table .gcc_except_table.*) }
107 /* Thread Local Storage sections */
108 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) }
109 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) }
110 .preinit_array :
111 {
112 PROVIDE /*_HIDDEN*/ (__preinit_array_start = .);
113 KEEP (*(.preinit_array))
114 PROVIDE /*_HIDDEN*/ (__preinit_array_end = .);
115 }
116 .init_array :
117 {
118 PROVIDE /*_HIDDEN*/ (__init_array_start = .);
119 KEEP (*(SORT(.init_array.*)))
120 KEEP (*(.init_array))
121 PROVIDE /*_HIDDEN*/ (__init_array_end = .);
122 }
123 .fini_array :
124 {
125 PROVIDE /*_HIDDEN*/ (__fini_array_start = .);
126 KEEP (*(.fini_array))
127 KEEP (*(SORT(.fini_array.*)))
128 PROVIDE /*_HIDDEN*/ (__fini_array_end = .);
129 }
130 .ctors :
131 {
132 /* gcc uses crtbegin.o to find the start of
133 the constructors, so we make sure it is
134 first. Because this is a wildcard, it
135 doesn't matter if the user does not
136 actually link against crtbegin.o; the
137 linker won't look for a file to match a
138 wildcard. The wildcard also means that it
139 doesn't matter which directory crtbegin.o
140 is in. */
141 KEEP (*crtbegin*.o(.ctors))
142 /* We don't want to include the .ctor section from
143 from the crtend.o file until after the sorted ctors.
144 The .ctor section from the crtend file contains the
145 end of ctors marker and it must be last */
146 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors))
147 KEEP (*(SORT(.ctors.*)))
148 KEEP (*(.ctors))
149 }
150 .dtors :
151 {
152 KEEP (*crtbegin*.o(.dtors))
153 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors))
154 KEEP (*(SORT(.dtors.*)))
155 KEEP (*(.dtors))
156 }
157 .jcr : { KEEP (*(.jcr)) }
158 .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) }
159 .dynamic : { *(.dynamic) } :dynamic :data
160 /* . = DATA_SEGMENT_RELRO_END (0, .);*/
161 .data :
162 {
163 *(.data .data.* .gnu.linkonce.d.*)
164 KEEP (*(.gnu.linkonce.d.*personality*))
165 SORT(CONSTRUCTORS)
166 }
167 .data1 : { *(.data1) }
168 .toc1 ALIGN(8) : { *(.toc1) }
169 .opd ALIGN(8) : { KEEP (*(.opd)) }
170 .got ALIGN(8) : { *(.got .toc) }
171 /* We want the small data sections together, so single-instruction offsets
172 can access them all, and initialized data all before uninitialized, so
173 we can shorten the on-disk segment size. */
174 .sdata :
175 {
176 *(.sdata .sdata.* .gnu.linkonce.s.*)
177 }
178 _edata = .; PROVIDE (edata = .);
179 .plt : { *(.plt) }
180 . = ALIGN(64 / 8);
181 . = ALIGN(64 / 8);
182 . = DATA_SEGMENT_END (.);
183 /* Hugepage area:
184 * Saving hugepages is more important than saving executable size, so
185 * we don't attempt to maintain congruence here.
186 * In order to map hugepages into the address space, we must advance the
187 * location counter to a segment boundary. If the address is < 4G, the
188 * next segment will be on a 256M boundary. For higher areas, we have a
189 * 1TB granularity. */
190 . = (. < 0x100000000) ? ALIGN(0x10000000) : ALIGN(0x10000000000);
191 /* HACK: workaround fact that kernel may not cope with segments with zero
192 * filesize */
193 .hugetlb.data : { LONG(1) } :htlb
194 __bss_start = .;
195 .tocbss ALIGN(8) : { *(.tocbss)} :htlb
196 .sbss :
197 {
198
199 *(.dynsbss)
200 *(.sbss .sbss.* .gnu.linkonce.sb.*)
201 *(.scommon)
202 }
203 .bss :
204 {
205 *(.dynbss)
206 *(.bss .bss.* .gnu.linkonce.b.*)
207 *(COMMON)
208 }
209 _end = .;
210 PROVIDE (end = .);
211 /* Stabs debugging sections. */
212 .stab 0 : { *(.stab) }
213 .stabstr 0 : { *(.stabstr) }
214 .stab.excl 0 : { *(.stab.excl) }
215 .stab.exclstr 0 : { *(.stab.exclstr) }
216 .stab.index 0 : { *(.stab.index) }
217 .stab.indexstr 0 : { *(.stab.indexstr) }
218 .comment 0 : { *(.comment) }
219 /* DWARF debug sections.
220 Symbols in the DWARF debugging sections are relative to the beginning
221 of the section so we begin them at 0. */
222 /* DWARF 1 */
223 .debug 0 : { *(.debug) }
224 .line 0 : { *(.line) }
225 /* GNU DWARF 1 extensions */
226 .debug_srcinfo 0 : { *(.debug_srcinfo) }
227 .debug_sfnames 0 : { *(.debug_sfnames) }
228 /* DWARF 1.1 and DWARF 2 */
229 .debug_aranges 0 : { *(.debug_aranges) }
230 .debug_pubnames 0 : { *(.debug_pubnames) }
231 /* DWARF 2 */
232 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
233 .debug_abbrev 0 : { *(.debug_abbrev) }
234 .debug_line 0 : { *(.debug_line) }
235 .debug_frame 0 : { *(.debug_frame) }
236 .debug_str 0 : { *(.debug_str) }
237 .debug_loc 0 : { *(.debug_loc) }
238 .debug_macinfo 0 : { *(.debug_macinfo) }
239 /* SGI/MIPS DWARF 2 extensions */
240 .debug_weaknames 0 : { *(.debug_weaknames) }
241 .debug_funcnames 0 : { *(.debug_funcnames) }
242 .debug_typenames 0 : { *(.debug_typenames) }
243 .debug_varnames 0 : { *(.debug_varnames) }
244 /DISCARD/ : { *(.note.GNU-stack) }
245 }