| 1 | # This is for embedded products (no MMU) with ELF. |
| 2 | MACHINE= |
| 3 | SCRIPT_NAME=elf |
| 4 | TEMPLATE_NAME=elf32 |
| 5 | |
| 6 | # Symbols have underscore prepended. |
| 7 | OUTPUT_FORMAT="elf32-us-cris" |
| 8 | NO_REL_RELOCS=yes |
| 9 | ARCH=cris |
| 10 | MAXPAGESIZE=32 |
| 11 | ENTRY=__start |
| 12 | EMBEDDED=yes |
| 13 | ALIGNMENT=32 |
| 14 | TEXT_START_ADDR=0 |
| 15 | |
| 16 | # Put crt0 for flash/eprom etc. in this section. |
| 17 | INITIAL_READONLY_SECTIONS= |
| 18 | if test -z "${CREATE_SHLIB}"; then |
| 19 | INITIAL_READONLY_SECTIONS=".interp ${RELOCATING-0} : { *(.interp) }" |
| 20 | fi |
| 21 | INITIAL_READONLY_SECTIONS="${INITIAL_READONLY_SECTIONS} |
| 22 | .startup : { KEEP(*(.startup)) }" |
| 23 | |
| 24 | # Setting __Stext to . in TEXT_START_SYMBOLS doesn't get what we want |
| 25 | # most of the time, which is the start of all read-only sections; |
| 26 | # there's at least .startup and .init before it. We have to resort to |
| 27 | # trickery. Note that __Stext is always defined, not PROVIDE:d, since |
| 28 | # external tools look for it. |
| 29 | TEXT_START_SYMBOLS='__Stext = ADDR (.startup);' |
| 30 | |
| 31 | # The __start dance is to get us through assumptions about entry |
| 32 | # symbols, and to clear _start for normal use with sane programs. |
| 33 | EXECUTABLE_SYMBOLS=' |
| 34 | __start = DEFINED(__start) ? __start : |
| 35 | DEFINED(_start) ? _start : |
| 36 | DEFINED(start) ? start : |
| 37 | DEFINED(.startup) ? .startup + 2 : 2; |
| 38 | ' |
| 39 | |
| 40 | # Smuggle an "OTHER_TEXT_END_SYMBOLS" here. |
| 41 | OTHER_READONLY_SECTIONS="${RELOCATING+PROVIDE (__Etext = .);}" |
| 42 | DATA_START_SYMBOLS='PROVIDE (__Sdata = .);' |
| 43 | |
| 44 | # Smuggle an "OTHER_DATA_END_SYMBOLS" here. |
| 45 | OTHER_SDATA_SECTIONS="${RELOCATING+PROVIDE (__Edata = .);}" |
| 46 | |
| 47 | # If .bss does not immediately follow .data but has its own start |
| 48 | # address, we can't get to it with OTHER_BSS_SYMBOLS, neither can we |
| 49 | # use ADDR(.bss) there. Instead, we use the symbol support for the |
| 50 | # end symbol. |
| 51 | OTHER_BSS_END_SYMBOLS=' |
| 52 | PROVIDE (__Ebss = .); |
| 53 | __Sbss = ADDR (.bss); |
| 54 | PROVIDE (_bss_start = __Sbss); |
| 55 | ' |
| 56 | OTHER_END_SYMBOLS='PROVIDE (__end = .);' |
| 57 | |
| 58 | INIT_ADDR='ALIGN (2)' |
| 59 | |
| 60 | INIT_START=' |
| 61 | ___init__start = .; |
| 62 | PROVIDE (___do_global_ctors = .); |
| 63 | ' |
| 64 | |
| 65 | INIT_END=' |
| 66 | PROVIDE (__init__end = .); |
| 67 | PROVIDE (___init__end = .); |
| 68 | ' |
| 69 | |
| 70 | FINI_ADDR='ALIGN (2)' |
| 71 | |
| 72 | FINI_START=' |
| 73 | ___fini__start = .; |
| 74 | PROVIDE (___do_global_dtors = .); |
| 75 | ' |
| 76 | |
| 77 | FINI_END=' |
| 78 | PROVIDE (__fini__end = .); |
| 79 | ___fini__end = .; |
| 80 | ' |
| 81 | |
| 82 | CTOR_START=' |
| 83 | PROVIDE (___ctors = .); |
| 84 | ___elf_ctors_dtors_begin = .; |
| 85 | ' |
| 86 | |
| 87 | CTOR_END=' |
| 88 | PROVIDE (___ctors_end = .); |
| 89 | ' |
| 90 | |
| 91 | DTOR_START=' |
| 92 | PROVIDE (___dtors = .); |
| 93 | ' |
| 94 | |
| 95 | CTOR_END=' |
| 96 | PROVIDE (___dtors_end = .); |
| 97 | ___elf_ctors_dtors_end = .; |
| 98 | ' |
| 99 | |
| 100 | # Also add the other symbols provided for rsim/xsim and elinux. |
| 101 | OTHER_SYMBOLS=' |
| 102 | PROVIDE (__Eall = .); |
| 103 | PROVIDE (__Endmem = 0x10000000); |
| 104 | PROVIDE (__Stacksize = 0); |
| 105 | ' |
| 106 | NO_SMALL_DATA=yes |