ARC: Fix ld/pr24511 test
[deliverable/binutils-gdb.git] / ld / scripttempl / elfarc.sc
CommitLineData
886a2506
NC
1#
2# Unusual variables checked by this code:
3# NOP - four byte opcode for no-op (defaults to 0)
4# NO_SMALL_DATA - no .sbss/.sbss2/.sdata/.sdata2 sections if not
5# empty.
6# DATA_ADDR - if end-of-text-plus-one-page isn't right for data start
7# INITIAL_READONLY_SECTIONS - at start of text segment
8# OTHER_READONLY_SECTIONS - other than .text .init .rodata ...
9# (e.g., .PARISC.milli)
10# OTHER_TEXT_SECTIONS - these get put in .text when relocating
11# OTHER_READWRITE_SECTIONS - other than .data .bss .ctors .sdata ...
12# (e.g., .PARISC.global)
13# OTHER_BSS_SECTIONS - other than .bss .sbss ...
14# OTHER_SECTIONS - at the end
15# EXECUTABLE_SYMBOLS - symbols that must be defined for an
16# executable (e.g., _DYNAMIC_LINK)
17# TEXT_START_SYMBOLS - symbols that appear at the start of the
18# .text section.
19# DATA_START_SYMBOLS - symbols that appear at the start of the
20# .data section.
21# OTHER_GOT_SYMBOLS - symbols defined just before .got.
22# OTHER_GOT_SECTIONS - sections just after .got.
23# OTHER_SDATA_SECTIONS - sections just after .sdata.
24# OTHER_BSS_SYMBOLS - symbols that appear at the start of the
25# .bss section besides __bss_start.
26# DATA_PLT - .plt should be in data segment, not text segment.
27# BSS_PLT - .plt should be in bss segment
28# TEXT_DYNAMIC - .dynamic in text segment, not data segment.
6c19b93b 29# EMBEDDED - whether this is for an embedded system.
886a2506
NC
30# SHLIB_TEXT_START_ADDR - if set, add to SIZEOF_HEADERS to set
31# start address of shared library.
32# INPUT_FILES - INPUT command of files to always include
33# WRITABLE_RODATA - if set, the .rodata section should be writable
34# INIT_START, INIT_END - statements just before and just after
6c19b93b 35# combination of .init sections.
886a2506 36# FINI_START, FINI_END - statements just before and just after
6c19b93b 37# combination of .fini sections.
886a2506
NC
38# STACK_ADDR - start of a .stack section.
39# OTHER_END_SYMBOLS - symbols to place right at the end of the script.
40#
41# When adding sections, do note that the names of some sections are used
42# when specifying the start address of the next.
43#
44
45# Many sections come in three flavours. There is the 'real' section,
46# like ".data". Then there are the per-procedure or per-variable
47# sections, generated by -ffunction-sections and -fdata-sections in GCC,
48# and useful for --gc-sections, which for a variable "foo" might be
49# ".data.foo". Then there are the linkonce sections, for which the linker
50# eliminates duplicates, which are named like ".gnu.linkonce.d.foo".
51# The exact correspondences are:
52#
53# Section Linkonce section
54# .text .gnu.linkonce.t.foo
55# .rodata .gnu.linkonce.r.foo
56# .data .gnu.linkonce.d.foo
57# .bss .gnu.linkonce.b.foo
58# .sdata .gnu.linkonce.s.foo
59# .sbss .gnu.linkonce.sb.foo
60# .sdata2 .gnu.linkonce.s2.foo
61# .sbss2 .gnu.linkonce.sb2.foo
62# .debug_info .gnu.linkonce.wi.foo
63# .tdata .gnu.linkonce.td.foo
64# .tbss .gnu.linkonce.tb.foo
65#
66# Each of these can also have corresponding .rel.* and .rela.* sections.
67
68test -z "$ENTRY" && ENTRY=start
69test -z "${BIG_OUTPUT_FORMAT}" && BIG_OUTPUT_FORMAT=${OUTPUT_FORMAT}
70test -z "${LITTLE_OUTPUT_FORMAT}" && LITTLE_OUTPUT_FORMAT=${OUTPUT_FORMAT}
71# If we request a big endian toolchain, give a big endian linker
72test "${ARC_ENDIAN}" == "big" && OUTPUT_FORMAT=${BIG_OUTPUT_FORMAT}
73if [ -z "$MACHINE" ]; then OUTPUT_ARCH=${ARCH}; else OUTPUT_ARCH=${ARCH}:${MACHINE}; fi
74test -z "${ELFSIZE}" && ELFSIZE=32
75test -z "${ALIGNMENT}" && ALIGNMENT="${ELFSIZE} / 8"
76test "$LD_FLAG" = "N" && DATA_ADDR=.
77test -n "$CREATE_SHLIB$CREATE_PIE" && test -n "$SHLIB_DATA_ADDR" && COMMONPAGESIZE=""
78test -z "$CREATE_SHLIB$CREATE_PIE" && test -n "$DATA_ADDR" && COMMONPAGESIZE=""
79DATA_SEGMENT_ALIGN="ALIGN(${SEGMENT_SIZE}) + (. & (${MAXPAGESIZE} - 1))"
80DATA_SEGMENT_END=""
81if test -n "${COMMONPAGESIZE}"; then
82 DATA_SEGMENT_ALIGN="ALIGN (${SEGMENT_SIZE}) - ((${MAXPAGESIZE} - .) & (${MAXPAGESIZE} - 1)); . = DATA_SEGMENT_ALIGN (${MAXPAGESIZE}, ${COMMONPAGESIZE})"
83 DATA_SEGMENT_END=". = DATA_SEGMENT_END (.);"
84fi
85INTERP=".interp ${RELOCATING-0} : { *(.interp) }"
86PLT=".plt ${RELOCATING-0} : { *(.plt) }"
2bf2bf23 87test -z "$GOT" && GOT=".got ${RELOCATING-0} : {${RELOCATING+ *(.got.plt)} *(.got) }"
886a2506
NC
88DYNAMIC=".dynamic ${RELOCATING-0} : { *(.dynamic) }"
89RODATA=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.* .gnu.linkonce.r.*}) }"
90STACKNOTE="/DISCARD/ : { *(.note.GNU-stack) }"
91if test -z "${NO_SMALL_DATA}"; then
92 SBSS=".sbss ${RELOCATING-0} :
93 {
94 ${RELOCATING+PROVIDE (__sbss_start = .);}
95 ${RELOCATING+PROVIDE (___sbss_start = .);}
2bf2bf23 96 ${RELOCATING+*(.dynsbss)}
886a2506 97 *(.sbss${RELOCATING+ .sbss.* .gnu.linkonce.sb.*})
2bf2bf23 98 ${RELOCATING+*(.scommon)}
886a2506
NC
99 ${RELOCATING+PROVIDE (__sbss_end = .);}
100 ${RELOCATING+PROVIDE (___sbss_end = .);}
101 }"
102 SBSS2=".sbss2 ${RELOCATING-0} : { *(.sbss2${RELOCATING+ .sbss2.* .gnu.linkonce.sb2.*}) }"
103 SDATA="/* We want the small data sections together, so single-instruction offsets
104 can access them all, and initialized data all before uninitialized, so
105 we can shorten the on-disk segment size. */
6c19b93b 106 .sdata ${RELOCATING-0} :
886a2506
NC
107 {
108 ${RELOCATING+${SDATA_START_SYMBOLS}}
109 *(.sdata${RELOCATING+ .sdata.* .gnu.linkonce.s.*})
110 }"
111 SDATA2=".sdata2 ${RELOCATING-0} : { *(.sdata2${RELOCATING+ .sdata2.* .gnu.linkonce.s2.*}) }"
112 REL_SDATA=".rel.sdata ${RELOCATING-0} : { *(.rel.sdata${RELOCATING+ .rel.sdata.* .rel.gnu.linkonce.s.*}) }
113 .rela.sdata ${RELOCATING-0} : { *(.rela.sdata${RELOCATING+ .rela.sdata.* .rela.gnu.linkonce.s.*}) }"
114 REL_SBSS=".rel.sbss ${RELOCATING-0} : { *(.rel.sbss${RELOCATING+ .rel.sbss.* .rel.gnu.linkonce.sb.*}) }
115 .rela.sbss ${RELOCATING-0} : { *(.rela.sbss${RELOCATING+ .rela.sbss.* .rela.gnu.linkonce.sb.*}) }"
116 REL_SDATA2=".rel.sdata2 ${RELOCATING-0} : { *(.rel.sdata2${RELOCATING+ .rel.sdata2.* .rel.gnu.linkonce.s2.*}) }
117 .rela.sdata2 ${RELOCATING-0} : { *(.rela.sdata2${RELOCATING+ .rela.sdata2.* .rela.gnu.linkonce.s2.*}) }"
118 REL_SBSS2=".rel.sbss2 ${RELOCATING-0} : { *(.rel.sbss2${RELOCATING+ .rel.sbss2.* .rel.gnu.linkonce.sb2.*}) }
119 .rela.sbss2 ${RELOCATING-0} : { *(.rela.sbss2${RELOCATING+ .rela.sbss2.* .rela.gnu.linkonce.sb2.*}) }"
120fi
223d5266
SV
121INIT_ARRAY=".init_array ${RELOCATING-0} :
122 {
123 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_start = .);}}
124 KEEP (*(SORT(.init_array.*)))
125 KEEP (*(.init_array))
126 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__init_array_end = .);}}
127 }"
128FINI_ARRAY=".fini_array ${RELOCATING-0} :
129 {
130 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_start = .);}}
131 KEEP (*(SORT(.fini_array.*)))
132 KEEP (*(.fini_array))
133 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__fini_array_end = .);}}
134 }"
6c19b93b 135CTOR=".ctors ${CONSTRUCTING-0} :
886a2506
NC
136 {
137 ${CONSTRUCTING+${CTOR_START}}
138 /* gcc uses crtbegin.o to find the start of
139 the constructors, so we make sure it is
140 first. Because this is a wildcard, it
141 doesn't matter if the user does not
142 actually link against crtbegin.o; the
143 linker won't look for a file to match a
144 wildcard. The wildcard also means that it
145 doesn't matter which directory crtbegin.o
146 is in. */
147
148 KEEP (*crtbegin*.o(.ctors))
149
150 /* We don't want to include the .ctor section from
151 from the crtend.o file until after the sorted ctors.
152 The .ctor section from the crtend file contains the
153 end of ctors marker and it must be last */
154
155 KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .ctors))
156 KEEP (*(SORT(.ctors.*)))
157 KEEP (*(.ctors))
158 ${CONSTRUCTING+${CTOR_END}}
159 }"
160DTOR=".dtors ${CONSTRUCTING-0} :
161 {
162 ${CONSTRUCTING+${DTOR_START}}
163 KEEP (*crtbegin*.o(.dtors))
164 KEEP (*(EXCLUDE_FILE (*crtend*.o $OTHER_EXCLUDE_FILES) .dtors))
165 KEEP (*(SORT(.dtors.*)))
166 KEEP (*(.dtors))
167 ${CONSTRUCTING+${DTOR_END}}
168 }"
169STACK=" .stack ${RELOCATING-0}${RELOCATING+${STACK_ADDR}} :
170 {
171 ${RELOCATING+_stack = .;}
172 *(.stack)
173 }"
174
175# if this is for an embedded system, don't add SIZEOF_HEADERS.
176if [ -z "$EMBEDDED" ]; then
177 test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR} + SIZEOF_HEADERS"
178else
179 test -z "${TEXT_BASE_ADDRESS}" && TEXT_BASE_ADDRESS="${TEXT_START_ADDR}"
180fi
181
182cat <<EOF
183OUTPUT_FORMAT("${OUTPUT_FORMAT}", "${BIG_OUTPUT_FORMAT}",
184 "${LITTLE_OUTPUT_FORMAT}")
185OUTPUT_ARCH(${OUTPUT_ARCH})
186${RELOCATING+ENTRY(${ENTRY})}
187
188${RELOCATING+${LIB_SEARCH_DIRS}}
189${RELOCATING+/* Do we need any of these for elf?
190 __DYNAMIC = 0; ${STACKZERO+${STACKZERO}} ${SHLIB_PATH+${SHLIB_PATH}} */}
191${RELOCATING+${EXECUTABLE_SYMBOLS}}
192${RELOCATING+${INPUT_FILES}}
193${RELOCATING- /* For some reason, the Solaris linker makes bad executables
194 if gld -r is used and the intermediate file has sections starting
195 at non-zero addresses. Could be a Solaris ld bug, could be a GNU ld
196 bug. But for now assigning the zero vmas works. */}
197
198SECTIONS
199{
200 /* Read-only sections, merged into text segment: */
201 ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+PROVIDE (__executable_start = ${TEXT_START_ADDR}); . = ${TEXT_BASE_ADDRESS};}}}
202 ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
203 ${CREATE_PIE+${RELOCATING+. = ${SHLIB_TEXT_START_ADDR:-0} + SIZEOF_HEADERS;}}
204 ${CREATE_SHLIB-${INTERP}}
205 ${INITIAL_READONLY_SECTIONS}
206 ${TEXT_DYNAMIC+${DYNAMIC}}
207 .hash ${RELOCATING-0} : { *(.hash) }
208 .dynsym ${RELOCATING-0} : { *(.dynsym) }
209 .dynstr ${RELOCATING-0} : { *(.dynstr) }
210 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
211 .gnu.version_d ${RELOCATING-0}: { *(.gnu.version_d) }
212 .gnu.version_r ${RELOCATING-0}: { *(.gnu.version_r) }
213
214EOF
215if [ "x$COMBRELOC" = x ]; then
216 COMBRELOCCAT=cat
217else
218 COMBRELOCCAT="cat > $COMBRELOC"
219fi
220eval $COMBRELOCCAT <<EOF
221 .rel.init ${RELOCATING-0} : { *(.rel.init) }
222 .rela.init ${RELOCATING-0} : { *(.rela.init) }
223 .rel.text ${RELOCATING-0} : { *(.rel.text${RELOCATING+ .rel.text.* .rel.gnu.linkonce.t.*}) }
224 .rela.text ${RELOCATING-0} : { *(.rela.text${RELOCATING+ .rela.text.* .rela.gnu.linkonce.t.*}) }
225 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
226 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
227 .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.* .rel.gnu.linkonce.r.*}) }
228 .rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.* .rela.gnu.linkonce.r.*}) }
229 ${OTHER_READONLY_RELOC_SECTIONS}
230 .rel.data ${RELOCATING-0} : { *(.rel.data${RELOCATING+ .rel.data.* .rel.gnu.linkonce.d.*}) }
231 .rela.data ${RELOCATING-0} : { *(.rela.data${RELOCATING+ .rela.data.* .rela.gnu.linkonce.d.*}) }
232 .rel.tdata ${RELOCATING-0} : { *(.rel.tdata${RELOCATING+ .rel.tdata.* .rel.gnu.linkonce.td.*}) }
233 .rela.tdata ${RELOCATING-0} : { *(.rela.tdata${RELOCATING+ .rela.tdata.* .rela.gnu.linkonce.td.*}) }
234 .rel.tbss ${RELOCATING-0} : { *(.rel.tbss${RELOCATING+ .rel.tbss.* .rel.gnu.linkonce.tb.*}) }
235 .rela.tbss ${RELOCATING-0} : { *(.rela.tbss${RELOCATING+ .rela.tbss.* .rela.gnu.linkonce.tb.*}) }
236 .rel.ctors ${RELOCATING-0} : { *(.rel.ctors) }
237 .rela.ctors ${RELOCATING-0} : { *(.rela.ctors) }
238 .rel.dtors ${RELOCATING-0} : { *(.rel.dtors) }
239 .rela.dtors ${RELOCATING-0} : { *(.rela.dtors) }
240 .rel.got ${RELOCATING-0} : { *(.rel.got) }
241 .rela.got ${RELOCATING-0} : { *(.rela.got) }
242 ${OTHER_GOT_RELOC_SECTIONS}
243 ${REL_SDATA}
244 ${REL_SBSS}
245 ${REL_SDATA2}
246 ${REL_SBSS2}
247 .rel.bss ${RELOCATING-0} : { *(.rel.bss${RELOCATING+ .rel.bss.* .rel.gnu.linkonce.b.*}) }
248 .rela.bss ${RELOCATING-0} : { *(.rela.bss${RELOCATING+ .rela.bss.* .rela.gnu.linkonce.b.*}) }
249EOF
250if [ -n "$COMBRELOC" ]; then
251cat <<EOF
252 .rel.dyn ${RELOCATING-0} :
253 {
254EOF
6c19b93b 255sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rela\./d;s/^.*: { *\(.*\)}$/ \1/' $COMBRELOC
886a2506
NC
256cat <<EOF
257 }
258 .rela.dyn ${RELOCATING-0} :
259 {
260EOF
6c19b93b 261sed -e '/^[ ]*[{}][ ]*$/d;/:[ ]*$/d;/\.rel\./d;s/^.*: { *\(.*\)}/ \1/' $COMBRELOC
886a2506
NC
262cat <<EOF
263 }
264EOF
265fi
266cat <<EOF
267 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
268 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
269 ${OTHER_PLT_RELOC_SECTIONS}
270
6c19b93b
AM
271 .init ${RELOCATING-0} :
272 {
886a2506 273 ${RELOCATING+${INIT_START}}
2d3181c7 274 KEEP (*(SORT_NONE(.init)))
886a2506
NC
275 ${RELOCATING+${INIT_END}}
276 } =${NOP-0}
277
278 ${DATA_PLT-${BSS_PLT-${PLT}}}
684d5a10
JEM
279 .jlitab ${RELOCATING-0} :
280 {
281 ${RELOCATING+${JLI_START_TABLE}}
2bf2bf23
AM
282 ${RELOCATING+jlitab*.o(.jlitab*)}
283 *(.jlitab${RELOCATING+*})
684d5a10 284 } =${NOP-0}
886a2506
NC
285 .text ${RELOCATING-0} :
286 {
287 ${RELOCATING+${TEXT_START_SYMBOLS}}
288 *(.text .stub${RELOCATING+ .text.* .gnu.linkonce.t.*})
075a2b89 289 /* .gnu.warning sections are handled specially by elf.em. */
886a2506
NC
290 *(.gnu.warning)
291 ${RELOCATING+${OTHER_TEXT_SECTIONS}}
292 } =${NOP-0}
293 .text.init ${RELOCATING-0} :
294 {
295 *(.text.init)
296 } =${NOP-0}
297 .fini ${RELOCATING-0} :
298 {
299 ${RELOCATING+${FINI_START}}
2d3181c7 300 KEEP (*(SORT_NONE(.fini)))
886a2506
NC
301 ${RELOCATING+${FINI_END}}
302 } =${NOP-0}
303 ${RELOCATING+PROVIDE (__etext = .);}
304 ${RELOCATING+PROVIDE (_etext = .);}
305 ${RELOCATING+PROVIDE (etext = .);}
306 ${WRITABLE_RODATA-${RODATA}}
307 .rodata1 ${RELOCATING-0} : { *(.rodata1) }
308 ${CREATE_SHLIB-${SDATA2}}
309 ${CREATE_SHLIB-${SBSS2}}
310 ${OTHER_READONLY_SECTIONS}
c2e86386 311 .eh_frame_hdr ${RELOCATING-0} : { *(.eh_frame_hdr) }
2bf2bf23 312 .gcc_except_table ${RELOCATING-0} : ONLY_IF_RO { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
886a2506
NC
313
314 /* Adjust the address for the data segment. We want to adjust up to
315 the same address within the page on the next page up. */
316 ${CREATE_SHLIB-${CREATE_PIE-${RELOCATING+. = ${DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}}
317 ${CREATE_SHLIB+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
318 ${CREATE_PIE+${RELOCATING+. = ${SHLIB_DATA_ADDR-${DATA_SEGMENT_ALIGN}};}}
319
320 /* Exception handling */
2bf2bf23 321 .gcc_except_table ${RELOCATING-0} : ONLY_IF_RW { *(.gcc_except_table${RELOCATING+ .gcc_except_table.*}) }
886a2506
NC
322
323 /* Ensure the __preinit_array_start label is properly aligned. We
324 could instead move the label definition inside the section, but
325 the linker would then create the section even if it turns out to
326 be empty, which isn't pretty. */
327 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
328 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_start = .);}}
329 .preinit_array ${RELOCATING-0} : { *(.preinit_array) }
330 ${RELOCATING+${CREATE_SHLIB-PROVIDE (__preinit_array_end = .);}}
223d5266
SV
331 ${RELOCATING+${INIT_ARRAY}}
332 ${RELOCATING+${FINI_ARRAY}}
886a2506
NC
333
334 .data ${RELOCATING-0} :
335 {
336 ${RELOCATING+${DATA_START_SYMBOLS}}
337 *(.data${RELOCATING+ .data.* .gnu.linkonce.d.*})
338 ${CONSTRUCTING+SORT(CONSTRUCTORS)}
339 }
340 .data.init ${RELOCATING-0} :
341 {
342 *(.data.init)
343 }
344 .data1 ${RELOCATING-0} : { *(.data1) }
345 .tdata ${RELOCATING-0} : { *(.tdata${RELOCATING+ .tdata.* .gnu.linkonce.td.*}) }
346 .tbss ${RELOCATING-0} : { *(.tbss${RELOCATING+ .tbss.* .gnu.linkonce.tb.*})${RELOCATING+ *(.tcommon)} }
347 .eh_frame ${RELOCATING-0} : { KEEP (*(.eh_frame)) }
348 .gcc_except_table ${RELOCATING-0} : { *(.gcc_except_table) }
349 ${WRITABLE_RODATA+${RODATA}}
350 ${OTHER_READWRITE_SECTIONS}
351 ${TEXT_DYNAMIC-${DYNAMIC}}
352 ${RELOCATING+${CTOR}}
353 ${RELOCATING+${DTOR}}
354 .jcr ${RELOCATING-0} : { KEEP (*(.jcr)) }
355 ${DATA_PLT+${PLT}}
356 ${RELOCATING+${OTHER_GOT_SYMBOLS}}
357 ${GOT}
358 ${OTHER_GOT_SECTIONS}
359 ${CREATE_SHLIB+${SDATA2}}
360 ${CREATE_SHLIB+${SBSS2}}
361 ${SDATA}
362 ${OTHER_SDATA_SECTIONS}
363 ${RELOCATING+_edata = .;}
364 ${RELOCATING+PROVIDE (edata = .);}
365 ${RELOCATING+__bss_start = .;}
366 ${RELOCATING+${OTHER_BSS_SYMBOLS}}
367 ${SBSS}
368 ${BSS_PLT+${PLT}}
369 .bss ${RELOCATING-0} :
370 {
2bf2bf23
AM
371 ${RELOCATING+*(.dynbss)}
372 *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*})
373 ${RELOCATING+*(COMMON)
374 /* Align here to ensure that the .bss section occupies space up to
375 _end. Align after .bss to ensure correct alignment even if the
376 .bss section disappears because there are no input sections. */
377 . = ALIGN(${ALIGNMENT});}
886a2506
NC
378 }
379 ${OTHER_BSS_SECTIONS}
380 ${RELOCATING+. = ALIGN(${ALIGNMENT});}
381 ${RELOCATING+_end = .;}
382 ${RELOCATING+${OTHER_BSS_END_SYMBOLS}}
383 ${RELOCATING+PROVIDE (end = .);}
384 ${RELOCATING+${DATA_SEGMENT_END}}
2bf2bf23 385EOF
886a2506 386
2bf2bf23 387test -n "${RELOCATING}" && cat <<EOF
886a2506
NC
388 /* We want to be able to set a default stack / heap size in a dejagnu
389 board description file, but override it for selected test cases.
390 The options appear in the wrong order to do this with a single symbol -
391 ldflags comes after flags injected with per-file stanzas, and thus
392 the setting from ldflags prevails. */
2bf2bf23 393 .heap :
886a2506 394 {
2bf2bf23
AM
395 __start_heap = . ;
396 . = . + (DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : (DEFINED(__DEFAULT_HEAP_SIZE) ? __DEFAULT_HEAP_SIZE : 20k)) ;
397 __end_heap = . ;
886a2506
NC
398 }
399
2bf2bf23
AM
400 . = ALIGN(0x8);
401 .stack :
886a2506 402 {
2bf2bf23
AM
403 __stack = . ;
404 . = . + (DEFINED(__STACK_SIZE) ? __STACK_SIZE : (DEFINED(__DEFAULT_STACK_SIZE) ? __DEFAULT_STACK_SIZE : 64k)) ;
405 __stack_top = . ;
886a2506 406 }
2bf2bf23 407EOF
886a2506 408
2bf2bf23 409cat <<EOF
886a2506
NC
410 /* Stabs debugging sections. */
411 .stab 0 : { *(.stab) }
412 .stabstr 0 : { *(.stabstr) }
413 .stab.excl 0 : { *(.stab.excl) }
414 .stab.exclstr 0 : { *(.stab.exclstr) }
415 .stab.index 0 : { *(.stab.index) }
416 .stab.indexstr 0 : { *(.stab.indexstr) }
417
418 .comment 0 : { *(.comment) }
8cb31bad
CZ
419 .note.gnu.build-id : { *(.note.gnu.build-id) }
420EOF
886a2506 421
8cb31bad 422. $srcdir/scripttempl/DWARF.sc
886a2506 423
8cb31bad 424cat <<EOF
886a2506 425 /* ARC Extension Sections */
8cb31bad 426 .arcextmap 0 : { *(.arcextmap.*) }
886a2506 427
886a2506
NC
428 ${OTHER_SECTIONS}
429 ${RELOCATING+${OTHER_END_SYMBOLS}}
430 ${RELOCATING+${STACKNOTE}}
431}
432EOF
This page took 0.262737 seconds and 4 git commands to generate.