1*3d8817e4Smiod# Linker script for 386 COFF. This works on SVR3.2 and SCO Unix 3.2.2. 2*3d8817e4Smiod# Ian Taylor <ian@cygnus.com>. 3*3d8817e4Smiodtest -z "$ENTRY" && ENTRY=_start 4*3d8817e4Smiod# These are substituted in as variables in order to get '}' in a shell 5*3d8817e4Smiod# conditional expansion. 6*3d8817e4SmiodINIT='.init : { *(.init) }' 7*3d8817e4SmiodFINI='.fini : { *(.fini) }' 8*3d8817e4Smiodcat <<EOF 9*3d8817e4SmiodOUTPUT_FORMAT("${OUTPUT_FORMAT}") 10*3d8817e4Smiod${LIB_SEARCH_DIRS} 11*3d8817e4Smiod 12*3d8817e4SmiodENTRY(${ENTRY}) 13*3d8817e4Smiod 14*3d8817e4SmiodSECTIONS 15*3d8817e4Smiod{ 16*3d8817e4Smiod .text ${RELOCATING+ SIZEOF_HEADERS} : { 17*3d8817e4Smiod ${RELOCATING+ *(.init)} 18*3d8817e4Smiod *(.text) 19*3d8817e4Smiod ${RELOCATING+ *(.fini)} 20*3d8817e4Smiod ${RELOCATING+ etext = .}; 21*3d8817e4Smiod } 22*3d8817e4Smiod .data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : { 23*3d8817e4Smiod *(.data) 24*3d8817e4Smiod ${RELOCATING+ edata = .}; 25*3d8817e4Smiod } 26*3d8817e4Smiod .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : 27*3d8817e4Smiod { 28*3d8817e4Smiod *(.bss) 29*3d8817e4Smiod *(COMMON) 30*3d8817e4Smiod ${RELOCATING+ end = .}; 31*3d8817e4Smiod } 32*3d8817e4Smiod ${RELOCATING- ${INIT}} 33*3d8817e4Smiod ${RELOCATING- ${FINI}} 34*3d8817e4Smiod .stab 0 ${RELOCATING+(NOLOAD)} : 35*3d8817e4Smiod { 36*3d8817e4Smiod [ .stab ] 37*3d8817e4Smiod } 38*3d8817e4Smiod .stabstr 0 ${RELOCATING+(NOLOAD)} : 39*3d8817e4Smiod { 40*3d8817e4Smiod [ .stabstr ] 41*3d8817e4Smiod } 42*3d8817e4Smiod} 43*3d8817e4SmiodEOF 44