1# $MirOS: src/gnu/usr.bin/binutils/ld/scripttempl/sparccoff.sc,v 1.2 2005/03/13 16:07:08 tg Exp $
2#
3# Linker script for Sparc COFF.
4# Based on i386coff.sc by Ian Taylor <ian@cygnus.com>.
5test -z "$ENTRY" && ENTRY=_start
6cat <<EOF
7OUTPUT_FORMAT("${OUTPUT_FORMAT}")
8${LIB_SEARCH_DIRS}
9
10ENTRY(${ENTRY})
11
12SECTIONS
13{
14  .text ${RELOCATING+ SIZEOF_HEADERS} : {
15    *(.init)
16    *(.text)
17    ${RELOCATING+ etext  =  .;}
18    ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
19    ${CONSTRUCTING+ LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)}
20    ${CONSTRUCTING+ *(.ctors)}
21    ${CONSTRUCTING+ LONG(0)}
22    ${CONSTRUCTING+ ___CTOR_END__ = .;}
23    ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
24    ${CONSTRUCTING+ LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2)}
25    ${CONSTRUCTING+ *(.dtors)}
26    ${CONSTRUCTING+ LONG(0)}
27    ${CONSTRUCTING+ ___DTOR_END__ = .;}
28    *(.fini)
29    ${RELOCATING+ etext  =  .};
30  }
31  .data ${RELOCATING+ 0x400000 + (. & 0xffc00fff)} : {
32    *(.data)
33    ${RELOCATING+ edata  =  .};
34  }
35  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
36  {
37    *(.bss)
38    *(COMMON)
39    ${RELOCATING+ end = .};
40  }
41  .stab  0 ${RELOCATING+\(NOLOAD\)} :
42  {
43    [ .stab ]
44  }
45  .stabstr  0 ${RELOCATING+\(NOLOAD\)} :
46  {
47    [ .stabstr ]
48  }
49}
50EOF
51