1 # Linker script for i386 go32 (DJGPP) 2 # 3 # Copyright (C) 2014 Free Software Foundation, Inc. 4 # 5 # Copying and distribution of this file, with or without modification, 6 # are permitted in any medium without royalty provided the copyright 7 # notice and this notice are preserved. 8 9 test -z "$ENTRY" && ENTRY=start 10 EXE=${CONSTRUCTING+${RELOCATING+-exe}} 11 12 # These are substituted in as variables in order to get '}' in a shell 13 # conditional expansion. 14 CTOR='.ctor : { 15 *(SORT(.ctors.*)) 16 *(.ctor) 17 }' 18 DTOR='.dtor : { 19 *(SORT(.dtors.*)) 20 *(.dtor) 21 }' 22 23 cat <<EOF 24 /* Copyright (C) 2014 Free Software Foundation, Inc. 25 26 Copying and distribution of this script, with or without modification, 27 are permitted in any medium without royalty provided the copyright 28 notice and this notice are preserved. */ 29 30 OUTPUT_FORMAT("${OUTPUT_FORMAT}${EXE}") 31 32 ${RELOCATING+ENTRY (${ENTRY})} 33 34 SECTIONS 35 { 36 .text ${RELOCATING+ ${TARGET_PAGE_SIZE}+SIZEOF_HEADERS} : { 37 *(.text) 38 ${RELOCATING+*(.text.*)} 39 ${RELOCATING+*(.gnu.linkonce.t*)} 40 *(.const*) 41 *(.ro*) 42 ${RELOCATING+*(.gnu.linkonce.r*)} 43 ${RELOCATING+etext = . ; PROVIDE(_etext = .) ;} 44 ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});} 45 } 46 .data ${RELOCATING+ ${DATA_ALIGNMENT}} : { 47 ${RELOCATING+djgpp_first_ctor = . ; 48 *(SORT(.ctors.*)) 49 *(.ctor) 50 djgpp_last_ctor = . ;} 51 ${RELOCATING+djgpp_first_dtor = . ; 52 *(SORT(.dtors.*)) 53 *(.dtor) 54 djgpp_last_dtor = . ;} 55 *(.data) 56 ${RELOCATING+*(.data.*)} 57 58 ${RELOCATING+*(.gcc_exc*)} 59 ${RELOCATING+___EH_FRAME_BEGIN__ = . ;} 60 ${RELOCATING+*(.eh_fram*)} 61 ${RELOCATING+___EH_FRAME_END__ = . ;} 62 ${RELOCATING+LONG(0);} 63 64 ${RELOCATING+*(.gnu.linkonce.d*)} 65 ${RELOCATING+edata = . ; PROVIDE(_edata = .) ;} 66 ${RELOCATING+. = ALIGN(${SEGMENT_SIZE});} 67 } 68 ${CONSTRUCTING+${RELOCATING-$CTOR}} 69 ${CONSTRUCTING+${RELOCATING-$DTOR}} 70 .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} : 71 { 72 *(.bss${RELOCATING+ .bss.* .gnu.linkonce.b.*}) 73 *(COMMON) 74 ${RELOCATING+ end = . ; PROVIDE(_end = .) ;} 75 ${RELOCATING+ . = ALIGN(${SEGMENT_SIZE});} 76 } 77 /* Stabs debugging sections. */ 78 .stab 0 : { *(.stab) } 79 .stabstr 0 : { *(.stabstr) } 80 EOF 81 82 . $srcdir/scripttempl/DWARF.sc 83 84 cat <<EOF 85 } 86 EOF 87