1# $MirOS: src/gnu/usr.bin/binutils/ld/scripttempl/h8300.sc,v 1.2 2005/03/13 16:07:07 tg Exp $ 2# 3TORS=".tors : 4 { 5 ___ctors = . ; 6 *(.ctors) 7 ___ctors_end = . ; 8 ___dtors = . ; 9 *(.dtors) 10 ___dtors_end = . ; 11 } > ram" 12 13cat <<EOF 14OUTPUT_FORMAT("${OUTPUT_FORMAT}") 15OUTPUT_ARCH(${ARCH}) 16ENTRY("_start") 17 18MEMORY 19{ 20 /* 0xc4 is a magic entry. We should have the linker just 21 skip over it one day... */ 22 vectors : o = 0x0000, l = 0xc4 23 magicvectors : o = 0xc4, l = 0x3c 24 ram : o = 0x0100, l = 0xfdfc 25 /* The stack starts at the top of main ram. */ 26 topram : o = 0xfefc, l = 0x4 27 /* At the very top of the address space is the 8-bit area. */ 28 eight : o = 0xff00, l = 0x100 29} 30 31SECTIONS 32{ 33.vectors : 34 { 35 /* Use something like this to place a specific 36 function's address into the vector table. 37 38 SHORT (ABSOLUTE (_foobar)). */ 39 40 *(.vectors) 41 } ${RELOCATING+ > vectors} 42 43.init : 44 { 45 *(.init) 46 } ${RELOCATING+ > ram} 47 48.text : 49 { 50 *(.rodata) 51 *(.text) 52 *(.text.*) 53 *(.strings) 54 ${RELOCATING+ _etext = . ; } 55 } ${RELOCATING+ > ram} 56 57${CONSTRUCTING+${TORS}} 58 59.data : 60 { 61 *(.data) 62 *(.data.*) 63 *(.tiny) 64 ${RELOCATING+ _edata = . ; } 65 } ${RELOCATING+ > ram} 66 67.bss : 68 { 69 ${RELOCATING+ _bss_start = . ;} 70 *(.bss) 71 *(COMMON) 72 ${RELOCATING+ _end = . ; } 73 } ${RELOCATING+ >ram} 74 75.stack : 76 { 77 ${RELOCATING+ _stack = . ; } 78 *(.stack) 79 } ${RELOCATING+ > topram} 80 81.eight : 82 { 83 *(.eight) 84 } ${RELOCATING+ > eight} 85 86.stab 0 ${RELOCATING+\(NOLOAD\)} : 87 { 88 [ .stab ] 89 } 90 91.stabstr 0 ${RELOCATING+\(NOLOAD\)} : 92 { 93 [ .stabstr ] 94 } 95} 96EOF 97