1# Copyright (C) 2014-2021 Free Software Foundation, Inc. 2# 3# Copying and distribution of this file, with or without modification, 4# are permitted in any medium without royalty provided the copyright 5# notice and this notice are preserved. 6 7cat <<EOF 8/* Copyright (C) 2014-2021 Free Software Foundation, Inc. 9 10 Copying and distribution of this script, with or without modification, 11 are permitted in any medium without royalty provided the copyright 12 notice and this notice are preserved. */ 13 14OUTPUT_FORMAT("${OUTPUT_FORMAT}") 15OUTPUT_ARCH(${ARCH}) 16EOF 17 18test -n "${RELOCATING}" && cat <<EOF 19ENTRY ("_start") 20MEMORY 21{ 22 23 vectarea : o =0x00000, l = 0x0300 24 25 introm : o = 0x00400, l = 0x16000 26 /* The stack starts at the top of main ram. */ 27 28 dram : o = 0x8000 , l = 0xffff 29 /* At the very top of the address space is the 8-bit area. */ 30 31 ldata : o =0x4000 ,l = 0x0200 32} 33 34EOF 35 36cat <<EOF 37SECTIONS 38{ 39.init : 40 { 41 KEEP (*(SORT_NONE(.init))) 42 ${RELOCATING+KEEP (*(SORT_NONE(.fini)))} 43 } ${RELOCATING+ >introm} 44 45.text : 46 { 47 ${RELOCATING+*(.rodata)} 48 ${RELOCATING+*(.text.*)} 49 *(.text) 50 ${RELOCATING+ _etext = . ; } 51 } ${RELOCATING+ > introm} 52.data : 53 { 54 *(.data) 55 ${RELOCATING+*(.data.*)} 56 57 ${RELOCATING+ _edata = . ; } 58 } ${RELOCATING+ > dram} 59 60.bss : 61 { 62 ${RELOCATING+ _bss_start = . ;} 63 *(.bss) 64 ${RELOCATING+*(COMMON)} 65 ${RELOCATING+ _end = . ; } 66 } ${RELOCATING+ > dram} 67 68.ldata : 69 { 70 *(.ldata) 71 } ${RELOCATING+ > ldata} 72 73 74.vects : 75 { 76 *(.vects) 77 } ${RELOCATING+ > vectarea} 78 79} 80EOF 81