Import binutils 2.18
[nacl-binutils.git] / ld / emulparams / shelf32.sh
blobc72fadb8fa1a295380e6d18d5a48edf87e279ab3
1 # Note: this parameter script is sourced by the other
2 # sh[l]elf(32|64).sh parameter scripts.
3 SCRIPT_NAME=elf
4 OUTPUT_FORMAT=${OUTPUT_FORMAT-"elf32-sh64"}
5 TEXT_START_ADDR=0x1000
6 MAXPAGESIZE=128
7 ARCH=sh
8 MACHINE=sh5
9 ALIGNMENT=8
10 TEMPLATE_NAME=elf32
11 GENERATE_SHLIB_SCRIPT=yes
12 EMBEDDED=yes
14 DATA_START_SYMBOLS='PROVIDE (___data = .);'
16 # If data is located right after .text (not explicitly specified),
17 # then we need to align it to an 8-byte boundary.
18 OTHER_READONLY_SECTIONS='
19 PROVIDE (___rodata = DEFINED (.rodata) ? .rodata : 0);
20 . = ALIGN (8);
23 # Make _edata and .bss aligned by smuggling in an alignment directive.
24 OTHER_GOT_SECTIONS='. = ALIGN (8);'
26 # These are for compatibility with the COFF toolchain.
27 ENTRY=start
28 CTOR_START='___ctors = .;'
29 CTOR_END='___ctors_end = .;'
30 DTOR_START='___dtors = .;'
31 DTOR_END='___dtors_end = .;'
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).
42 test -z "$CREATE_SHLIB" && OTHER_SECTIONS="
43 .stack ${RELOCATING-0}${RELOCATING+(DEFINED(_stack) ? _stack : ALIGN (0x40000) + 0x80000)} :
45 ${RELOCATING+_stack = .;}
46 *(.stack)
47 LONG(0xdeaddead)
49 .cranges 0 : { *(.cranges) }
51 # We do not need .stack for shared library.
52 test -n "$CREATE_SHLIB" && OTHER_SECTIONS="
53 .cranges 0 : { *(.cranges) }
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.
58 EXTRA_EM_FILE=${EXTRA_EM_FILE-sh64elf}