1 # Copyright (C) 2014 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 7 TORS=".tors : 8 { 9 ___ctors = . ; 10 *(.ctors) 11 ___ctors_end = . ; 12 ___dtors = . ; 13 *(.dtors) 14 ___dtors_end = . ; 15 } > ram" 16 17 cat <<EOF 18 /* Copyright (C) 2014 Free Software Foundation, Inc. 19 20 Copying and distribution of this script, with or without modification, 21 are permitted in any medium without royalty provided the copyright 22 notice and this notice are preserved. */ 23 24 OUTPUT_FORMAT("${OUTPUT_FORMAT}") 25 OUTPUT_ARCH(${ARCH}) 26 27 SECTIONS 28 { 29 .text : 30 { 31 *(.text) 32 .init : { KEEP (*(.init)) } =0 33 .fini : { KEEP (*(.fini)) } =0 34 *(.strings) 35 ${RELOCATING+ _etext = . ; } 36 } ${RELOCATING+ > ram} 37 ${CONSTRUCTING+${TORS}} 38 .data : 39 { 40 *(.data) 41 ${RELOCATING+ _edata = . ; } 42 } ${RELOCATING+ > ram} 43 .bss : 44 { 45 ${RELOCATING+ _bss_start = . ; } 46 *(.bss) 47 *(COMMON) 48 ${RELOCATING+ _end = . ; } 49 } ${RELOCATING+ > ram} 50 .stack ${RELOCATING+ 0x30000 } : 51 { 52 ${RELOCATING+ _stack = . ; } 53 *(.stack) 54 } ${RELOCATING+ > ram} 55 .stab 0 ${RELOCATING+(NOLOAD)} : 56 { 57 *(.stab) 58 } 59 .stabstr 0 ${RELOCATING+(NOLOAD)} : 60 { 61 *(.stabstr) 62 } 63 } 64 EOF 65