Debian Codegraph @

ldscripts/elf32ppclinux.xBDT

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