1# Note: this parameter script is sourced by the other
2# sh[l]elf(32|64).sh parameter scripts.
3SCRIPT_NAME=elf
4OUTPUT_FORMAT=${OUTPUT_FORMAT-"elf32-sh64"}
5TEXT_START_ADDR=0x1000
6MAXPAGESIZE=128
7ARCH=sh
8MACHINE=sh5
9ALIGNMENT=8
10TEMPLATE_NAME=elf32
11GENERATE_SHLIB_SCRIPT=yes
12EMBEDDED=yes
13
14DATA_START_SYMBOLS='PROVIDE (___data = .);'
15
16# If data is located right after .text (not explicitly specified),
17# then we need to align it to an 8-byte boundary.
18OTHER_READONLY_SECTIONS='
19PROVIDE (___rodata = DEFINED (.rodata) ? .rodata : 0);
20. = ALIGN (8);
21'
22
23# Make _edata and .bss aligned by smuggling in an alignment directive.
24OTHER_GOT_SECTIONS='. = ALIGN (8);'
25
26# These are for compatibility with the COFF toolchain.
27ENTRY=start
28CTOR_START='___ctors = .;'
29CTOR_END='___ctors_end = .;'
30DTOR_START='___dtors = .;'
31DTOR_END='___dtors_end = .;'
32
33# Do not use the varname=${varname-'string'} construct here; there are
34# problems with that on some shells (e.g. on Solaris) where there is a bug
35# that trigs when $varname contains a "}".
36# The effect of the .stack definition is like setting STACK_ADDR to 0x80000,
37# except that the setting can be overridden, e.g. --defsym _stack=0xff000,
38# and that we put an extra sentinal value at the bottom.
39# N.B. We can't use PROVIDE to set the default value in a symbol because
40# the address is needed to place the .stack section, which in turn is needed
41# to hold the sentinel value(s).
42test -z "$CREATE_SHLIB" && OTHER_SECTIONS="
43  .stack ${RELOCATING-0}${RELOCATING+(DEFINED(_stack) ? _stack : ALIGN (0x40000) + 0x40000)} :
44  {
45    ${RELOCATING+_stack = .;}
46    *(.stack)
47    LONG(0xdeaddead)
48  }
49  .cranges 0 : { *(.cranges) }
50"
51# We do not need .stack for shared library.
52test -n "$CREATE_SHLIB" && OTHER_SECTIONS="
53  .cranges 0 : { *(.cranges) }
54"
55
56# We need to adjust sizes in the .cranges section after relaxation, so
57# we need an after_allocation function, and it goes in this file.
58EXTRA_EM_FILE=${EXTRA_EM_FILE-sh64elf}
59