1# $MirOS: src/gnu/usr.bin/binutils/ld/scripttempl/psos.sc,v 1.2 2005/03/13 16:07:08 tg Exp $
2#
3cat <<EOF
4OUTPUT_FORMAT(${OUTPUT_FORMAT})
5OUTPUT_ARCH(${ARCH})
6${RELOCATING+${LIB_SEARCH_DIRS}}
7
8SECTIONS
9{
10  .text ${RELOCATING:-0} ${RELOCATING+${TEXT_START_ADDR}} : {
11    ${RELOCATING+ start = DEFINED(_START) ? _START : DEFINED(_start) ? _start : .;}
12    ${RELOCATING+ PROVIDE(__text = .);}
13    *(.text);
14    *(code);
15    *(const);
16    *(strings);
17    *(pSOS);
18    *(pROBE);
19    *(pNA);
20    *(pHILE);
21    *(pREPC);
22    *(pRPC);
23    ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
24    ${CONSTRUCTING+ LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)}
25    ${CONSTRUCTING+ *(.ctors)}
26    ${CONSTRUCTING+ LONG(0);}
27    ${CONSTRUCTING+ ___CTOR_END__ = .;}
28    ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
29    ${CONSTRUCTING+ LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2);}
30    ${CONSTRUCTING+ *(.dtors);}
31    ${CONSTRUCTING+ LONG(0);}
32    ${CONSTRUCTING+ ___DTOR_END__ = .;}
33    ${RELOCATING+ PROVIDE(__etext = .);}
34    ${RELOCATING+ PROVIDE(_etext = .);}
35  }
36  .data ${RELOCATING:-0} : ${RELOCATING+ AT(ADDR(.text) + SIZEOF(.text))} {
37    ${RELOCATING+ PROVIDE(__data = .);}
38    *(.data);
39    *(vars);
40    ${RELOCATING+ PROVIDE(__edata = .);}
41    ${RELOCATING+ PROVIDE(_edata = .);}
42  }
43  .bss ${RELOCATING:-0} :
44  {
45    ${RELOCATING+ PROVIDE(__bss = .);}
46    *(.bss);
47    *(zerovars);
48    *(COMMON);
49    ${RELOCATING+ PROVIDE(__ebss = .);}
50    ${RELOCATING+ PROVIDE(__end = .);}
51    ${RELOCATING+ PROVIDE(_end = .);}
52    ${RELOCATING+ PROVIDE(_FreeMemStart = .);}
53  }
54  .stab 0 ${RELOCATING+\(NOLOAD\)} :
55  {
56    *(.stab);
57  }
58  .stabstr 0 ${RELOCATING+\(NOLOAD\)} :
59  {
60    *(.stabstr);
61  }
62}
63EOF
64