1# $MirOS: src/gnu/usr.bin/binutils/ld/scripttempl/i386coff.sc,v 1.2 2005/03/13 16:07:08 tg Exp $
2#
3# Linker script for 386 COFF.  This works on SVR3.2 and SCO Unix 3.2.2.
4# Ian Taylor <ian@cygnus.com>.
5test -z "$ENTRY" && ENTRY=_start
6# These are substituted in as variables in order to get '}' in a shell
7# conditional expansion.
8INIT='.init : { *(.init) }'
9FINI='.fini : { *(.fini) }'
10cat <<EOF
11OUTPUT_FORMAT("${OUTPUT_FORMAT}")
12${LIB_SEARCH_DIRS}
13
14ENTRY(${ENTRY})
15
16SECTIONS
17{
18  .text ${RELOCATING+ SIZEOF_HEADERS} : {
19    ${RELOCATING+ *(.init)}
20    *(.text)
21    ${RELOCATING+ *(.fini)}
22    ${RELOCATING+ etext  =  .};
23  }
24  .data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : {
25    *(.data)
26    ${RELOCATING+ edata  =  .};
27  }
28  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
29  {
30    *(.bss)
31    *(COMMON)
32    ${RELOCATING+ end = .};
33  }
34  ${RELOCATING- ${INIT}}
35  ${RELOCATING- ${FINI}}
36  .stab  0 ${RELOCATING+\(NOLOAD\)} :
37  {
38    [ .stab ]
39  }
40  .stabstr  0 ${RELOCATING+\(NOLOAD\)} :
41  {
42    [ .stabstr ]
43  }
44}
45EOF
46