direct-io.hg

view xen/arch/powerpc/xen.lds.S @ 11356:af7c87d42bc6

[XEN][POWERPC] Fix PHDR issues with large .data.percpu sections

This patch tells the link to only create one PHDR and place all sections
in it, also removing an unrequired mapping for the .data.percpu section.

This avoids the "Not enough room for program headers (allocated 2, need 3)"

Booted on a JS20.

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