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