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