|
1 /* Script for -z combreloc: combine and sort reloc sections */ |
|
2 OUTPUT_FORMAT("elf64-powerpc", "elf64-powerpc", |
|
3 "elf64-powerpc") |
|
4 OUTPUT_ARCH(powerpc:common64) |
|
5 ENTRY(_start) |
|
6 SEARCH_DIR("/usr/powerpc64-unknown-linux-gnu/lib64"); |
|
7 SEARCH_DIR("/usr/lib/binutils/powerpc64-unknown-linux-gnu/2.16.164"); |
|
8 SEARCH_DIR("/usr/local/lib64"); SEARCH_DIR("/lib64"); SEARCH_DIR("/usr/lib64"); |
|
9 SEARCH_DIR("/usr/powerpc64-unknown-linux-gnu/lib"); |
|
10 SEARCH_DIR("/usr/lib/binutils/powerpc64-unknown-linux-gnu/2.16.1"); |
|
11 SEARCH_DIR("/usr/local/lib"); SEARCH_DIR("/lib"); SEARCH_DIR("/usr/lib"); /* Do we |
|
12 need any of these for elf? + __DYNAMIC = 0; */ |
|
13 SECTIONS |
|
14 { |
|
15 /* Read-only sections, merged into text segment: */ |
|
16 PROVIDE (__executable_start = 0x60000000); . = 0x60000000 + SIZEOF_HEADERS; |
|
17 .interp : { *(.interp) } |
|
18 .hash : { *(.hash) } |
|
19 .dynsym : { *(.dynsym) } |
|
20 .dynstr : { *(.dynstr) } |
|
21 .gnu.version : { *(.gnu.version) } |
|
22 .gnu.version_d : { *(.gnu.version_d) } |
|
23 .gnu.version_r : { *(.gnu.version_r) } |
|
24 .rel.dyn : |
|
25 { |
|
26 *(.rel.init) |
|
27 *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*) |
|
28 *(.rel.fini) |
|
29 *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*) |
|
30 *(.rel.data.rel.ro*) |
|
31 *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*) |
|
32 *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*) |
|
33 *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*) |
|
34 *(.rel.ctors) |
|
35 *(.rel.dtors) |
|
36 *(.rel.got) |
|
37 *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*) |
|
38 *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*) |
|
39 *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*) |
|
40 *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*) |
|
41 *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*) |
|
42 } |
|
43 .rela.dyn : |
|
44 { |
|
45 *(.rela.init) |
|
46 *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
|
47 *(.rela.fini) |
|
48 *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
|
49 *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
|
50 *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
|
51 *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
|
52 *(.rela.ctors) |
|
53 *(.rela.dtors) |
|
54 *(.rela.got) |
|
55 *(.rela.toc) |
|
56 *(.rela.opd) |
|
57 *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*) |
|
58 *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*) |
|
59 *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*) |
|
60 *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*) |
|
61 *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
|
62 } |
|
63 .rel.plt : { *(.rel.plt) } |
|
64 .rela.plt : { *(.rela.plt) } |
|
65 .rela.tocbss : { *(.rela.tocbss) } |
|
66 .init : |
|
67 { |
|
68 KEEP (*(.init)) |
|
69 } =0x60000000 |
|
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 *(.sfpr .glink) |
|
77 } =0x60000000 |
|
78 .fini : |
|
79 { |
|
80 KEEP (*(.fini)) |
|
81 } =0x60000000 |
|
82 PROVIDE (__etext = .); |
|
83 PROVIDE (_etext = .); |
|
84 PROVIDE (etext = .); |
|
85 .rodata : { *(.rodata .rodata.* .gnu.linkonce.r.*) } |
|
86 .rodata1 : { *(.rodata1) } |
|
87 .sdata2 : { *(.sdata2 .sdata2.* .gnu.linkonce.s2.*) } |
|
88 .sbss2 : { *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*) } |
|
89 .eh_frame_hdr : { *(.eh_frame_hdr) } |
|
90 .eh_frame : ONLY_IF_RO { KEEP (*(.eh_frame)) } |
|
91 .gcc_except_table : ONLY_IF_RO { KEEP (*(.gcc_except_table)) |
|
92 *(.gcc_except_table.*) } /* Adjust the address for the data segment. We want to |
|
93 adjust up to + the same address within the page on the next page up. */ |
|
94 . = ALIGN (0x10000) - ((0x10000 - .) & (0x10000 - 1)); . = DATA_SEGMENT_ALIGN |
|
95 (0x10000, 0x1000); /* Exception handling */ |
|
96 .eh_frame : ONLY_IF_RW { KEEP (*(.eh_frame)) } |
|
97 .gcc_except_table : ONLY_IF_RW { KEEP (*(.gcc_except_table)) |
|
98 *(.gcc_except_table.*) } /* Thread Local Storage sections */ |
|
99 .tdata : { *(.tdata .tdata.* .gnu.linkonce.td.*) } |
|
100 .tbss : { *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) } |
|
101 /* Ensure the __preinit_array_start label is properly aligned. We |
|
102 could instead move the label definition inside the section, but |
|
103 the linker would then create the section even if it turns out to |
|
104 be empty, which isn't pretty. */ |
|
105 . = ALIGN(64 / 8); |
|
106 PROVIDE (__preinit_array_start = .); |
|
107 .preinit_array : { KEEP (*(.preinit_array)) } |
|
108 PROVIDE (__preinit_array_end = .); |
|
109 PROVIDE (__init_array_start = .); |
|
110 .init_array : { KEEP (*(.init_array)) } |
|
111 PROVIDE (__init_array_end = .); |
|
112 PROVIDE (__fini_array_start = .); |
|
113 .fini_array : { KEEP (*(.fini_array)) } |
|
114 PROVIDE (__fini_array_end = .); |
|
115 .ctors : |
|
116 { |
|
117 /* gcc uses crtbegin.o to find the start of |
|
118 the constructors, so we make sure it is |
|
119 first. Because this is a wildcard, it |
|
120 doesn't matter if the user does not |
|
121 actually link against crtbegin.o; the |
|
122 linker won't look for a file to match a |
|
123 wildcard. The wildcard also means that it |
|
124 doesn't matter which directory crtbegin.o |
|
125 is in. */ |
|
126 KEEP (*crtbegin*.o(.ctors)) |
|
127 /* We don't want to include the .ctor section from |
|
128 from the crtend.o file until after the sorted ctors. |
|
129 The .ctor section from the crtend file contains the |
|
130 end of ctors marker and it must be last */ |
|
131 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .ctors)) |
|
132 KEEP (*(SORT(.ctors.*))) |
|
133 KEEP (*(.ctors)) |
|
134 } |
|
135 .dtors : |
|
136 { |
|
137 KEEP (*crtbegin*.o(.dtors)) |
|
138 KEEP (*(EXCLUDE_FILE (*crtend*.o ) .dtors)) |
|
139 KEEP (*(SORT(.dtors.*))) |
|
140 KEEP (*(.dtors)) |
|
141 } |
|
142 .jcr : { KEEP (*(.jcr)) } |
|
143 .data.rel.ro : { *(.data.rel.ro.local) *(.data.rel.ro*) } |
|
144 .dynamic : { *(.dynamic) } |
|
145 . = DATA_SEGMENT_RELRO_END (0, .); |
|
146 .data : |
|
147 { |
|
148 *(.data .data.* .gnu.linkonce.d.*) |
|
149 KEEP (*(.gnu.linkonce.d.*personality*)) |
|
150 SORT(CONSTRUCTORS) |
|
151 } |
|
152 .data1 : { *(.data1) } |
|
153 .toc1 ALIGN(8) : { *(.toc1) } |
|
154 .opd ALIGN(8) : { KEEP (*(.opd)) } |
|
155 .got ALIGN(8) : { *(.got .toc) } |
|
156 /* We want the small data sections together, so single-instruction offsets |
|
157 can access them all, and initialized data all before uninitialized, so |
|
158 we can shorten the on-disk segment size. */ |
|
159 .sdata : |
|
160 { |
|
161 *(.sdata .sdata.* .gnu.linkonce.s.*) |
|
162 } |
|
163 _edata = .; |
|
164 PROVIDE (edata = .); |
|
165 __bss_start = .; |
|
166 .tocbss ALIGN(8) : { *(.tocbss)} |
|
167 .sbss : |
|
168 { |
|
169 PROVIDE (__sbss_start = .); |
|
170 PROVIDE (___sbss_start = .); |
|
171 *(.dynsbss) |
|
172 *(.sbss .sbss.* .gnu.linkonce.sb.*) |
|
173 *(.scommon) |
|
174 PROVIDE (__sbss_end = .); |
|
175 PROVIDE (___sbss_end = .); |
|
176 } |
|
177 .plt : { *(.plt) } |
|
178 .bss : |
|
179 { |
|
180 *(.dynbss) |
|
181 *(.bss .bss.* .gnu.linkonce.b.*) |
|
182 *(COMMON) |
|
183 /* Align here to ensure that the .bss section occupies space up to |
|
184 _end. Align after .bss to ensure correct alignment even if the |
|
185 .bss section disappears because there are no input sections. */ |
|
186 . = ALIGN(64 / 8); |
|
187 } |
|
188 . = ALIGN(64 / 8); |
|
189 _end = .; |
|
190 PROVIDE (end = .); |
|
191 . = DATA_SEGMENT_END (.); |
|
192 /* Stabs debugging sections. */ |
|
193 .stab 0 : { *(.stab) } |
|
194 .stabstr 0 : { *(.stabstr) } |
|
195 .stab.excl 0 : { *(.stab.excl) } |
|
196 .stab.exclstr 0 : { *(.stab.exclstr) } |
|
197 .stab.index 0 : { *(.stab.index) } |
|
198 .stab.indexstr 0 : { *(.stab.indexstr) } |
|
199 .comment 0 : { *(.comment) } |
|
200 /* DWARF debug sections. |
|
201 Symbols in the DWARF debugging sections are relative to the beginning |
|
202 of the section so we begin them at 0. */ |
|
203 /* DWARF 1 */ |
|
204 .debug 0 : { *(.debug) } |
|
205 .line 0 : { *(.line) } |
|
206 /* GNU DWARF 1 extensions */ |
|
207 .debug_srcinfo 0 : { *(.debug_srcinfo) } |
|
208 .debug_sfnames 0 : { *(.debug_sfnames) } |
|
209 /* DWARF 1.1 and DWARF 2 */ |
|
210 .debug_aranges 0 : { *(.debug_aranges) } |
|
211 .debug_pubnames 0 : { *(.debug_pubnames) } |
|
212 /* DWARF 2 */ |
|
213 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) } |
|
214 .debug_abbrev 0 : { *(.debug_abbrev) } |
|
215 .debug_line 0 : { *(.debug_line) } |
|
216 .debug_frame 0 : { *(.debug_frame) } |
|
217 .debug_str 0 : { *(.debug_str) } |
|
218 .debug_loc 0 : { *(.debug_loc) } |
|
219 .debug_macinfo 0 : { *(.debug_macinfo) } |
|
220 /* SGI/MIPS DWARF 2 extensions */ |
|
221 .debug_weaknames 0 : { *(.debug_weaknames) } |
|
222 .debug_funcnames 0 : { *(.debug_funcnames) } |
|
223 .debug_typenames 0 : { *(.debug_typenames) } |
|
224 .debug_varnames 0 : { *(.debug_varnames) } |
|
225 /DISCARD/ : { *(.note.GNU-stack) } |
|
226 } |