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