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