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