| 1 | SCRIPT_NAME=elf |
| 2 | TEMPLATE_NAME=elf |
| 3 | OUTPUT_FORMAT="elf32-tic6x-le" |
| 4 | BIG_OUTPUT_FORMAT="elf32-tic6x-be" |
| 5 | EXTRA_EM_FILE=tic6xdsbt |
| 6 | GENERATE_SHLIB_SCRIPT=yes |
| 7 | # This address is an arbitrary value expected to be suitable for |
| 8 | # semihosting simulator use, but not on hardware where it is expected |
| 9 | # to be overridden. |
| 10 | case ${target} in |
| 11 | *-elf) |
| 12 | TEXT_START_ADDR=0x8000 |
| 13 | ;; |
| 14 | *-uclinux) |
| 15 | TEXT_START_ADDR=0x0 |
| 16 | GOT=" |
| 17 | .got ${RELOCATING-0} : { |
| 18 | ${RELOCATING+*(.dsbt) |
| 19 | *(.got.plt) *(.igot.plt) }*(.got)${RELOCATING+ *(.igot)} |
| 20 | }" |
| 21 | ;; |
| 22 | esac |
| 23 | MAXPAGESIZE="CONSTANT (MAXPAGESIZE)" |
| 24 | ARCH=tic6x |
| 25 | OTHER_GOT_SYMBOLS="PROVIDE_HIDDEN (__c6xabi_DSBT_BASE = .);" |
| 26 | # ".bss" is near (small) BSS, ".far" is far (normal) BSS, ".const" is |
| 27 | # far read-only data, ".rodata" is near read-only data. ".neardata" |
| 28 | # is near (small) data, ".fardata" is (along with .data) far data. |
| 29 | RODATA_NAME="const" |
| 30 | SDATA_NAME="neardata" |
| 31 | SBSS_NAME="bss" |
| 32 | BSS_NAME="far" |
| 33 | OTHER_READONLY_SECTIONS=" |
| 34 | .c6xabi.extab ${RELOCATING-0} : { *(.c6xabi.extab${RELOCATING+* .gnu.linkonce.c6xabiextab.*}) } |
| 35 | .c6xabi.exidx ${RELOCATING-0} : |
| 36 | { |
| 37 | ${RELOCATING+PROVIDE_HIDDEN (__exidx_start = .);} |
| 38 | *(.c6xabi.exidx${RELOCATING+* .gnu.linkonce.c6xabiexidx.*}) |
| 39 | ${RELOCATING+PROVIDE_HIDDEN (__exidx_end = .);} |
| 40 | }" |
| 41 | OTHER_SDATA_SECTIONS=".rodata ${RELOCATING-0} : { *(.rodata${RELOCATING+ .rodata.*}) }" |
| 42 | OTHER_READONLY_RELOC_SECTIONS=" |
| 43 | .rel.rodata ${RELOCATING-0} : { *(.rel.rodata${RELOCATING+ .rel.rodata.*}) } |
| 44 | .rela.rodata ${RELOCATING-0} : { *(.rela.rodata${RELOCATING+ .rela.rodata.*}) }" |
| 45 | OTHER_READWRITE_SECTIONS=".fardata ${RELOCATING-0} : { *(.fardata${RELOCATING+ .fardata.*}) }" |
| 46 | OTHER_READWRITE_RELOC_SECTIONS=" |
| 47 | .rel.fardata ${RELOCATING-0} : { *(.rel.fardata${RELOCATING+ .rel.fardata.*}) } |
| 48 | .rela.fardata ${RELOCATING-0} : { *(.rela.fardata${RELOCATING+ .rela.fardata.*}) }" |
| 49 | # For relocating operation, skip OTHER_BSS_SECTIONS, or will cause multiple definition. |
| 50 | if [ ${RELOCATING-0} ]; then |
| 51 | OTHER_BSS_SECTIONS=""; |
| 52 | else |
| 53 | case ${target} in |
| 54 | |
| 55 | *-elf) |
| 56 | OTHER_BSS_SECTIONS=" |
| 57 | .heap : |
| 58 | { |
| 59 | . = ALIGN(4); |
| 60 | _HEAP_START = .; |
| 61 | . += 0x2000000; |
| 62 | _HEAP_MAX = .; |
| 63 | } |
| 64 | .stack : |
| 65 | { |
| 66 | . += 0x100000; |
| 67 | _STACK_START = .; |
| 68 | }" |
| 69 | ;; |
| 70 | esac |
| 71 | fi |
| 72 | ATTRS_SECTIONS='.c6xabi.attributes 0 : { KEEP (*(.c6xabi.attributes)) KEEP (*(.gnu.attributes)) }' |