Debian Codegraph @

ldscripts/elf32ppclinux.xB

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