1# Copyright (C) 2014-2016 Free Software Foundation, Inc.
2#
3# Copying and distribution of this file, with or without modification,
4# are permitted in any medium without royalty provided the copyright
5# notice and this notice are preserved.
6
7cat <<EOF
8/* Copyright (C) 2014-2016 Free Software Foundation, Inc.
9
10   Copying and distribution of this script, with or without modification,
11   are permitted in any medium without royalty provided the copyright
12   notice and this notice are preserved.  */
13
14OUTPUT_FORMAT(${OUTPUT_FORMAT})
15OUTPUT_ARCH(${ARCH})
16${RELOCATING+${LIB_SEARCH_DIRS}}
17
18SECTIONS
19{
20  .text ${RELOCATING:-0} ${RELOCATING+${TEXT_START_ADDR}} : {
21    ${RELOCATING+ start = DEFINED(_START) ? _START : DEFINED(_start) ? _start : .;}
22    ${RELOCATING+ PROVIDE(__text = .);}
23    *(.text);
24    *(code);
25    *(const);
26    *(strings);
27    *(pSOS);
28    *(pROBE);
29    *(pNA);
30    *(pHILE);
31    *(pREPC);
32    *(pRPC);
33    ${CONSTRUCTING+ ___CTOR_LIST__ = .;}
34    ${CONSTRUCTING+ LONG((___CTOR_END__ - ___CTOR_LIST__) / 4 - 2)}
35    ${CONSTRUCTING+ *(.ctors)}
36    ${CONSTRUCTING+ LONG(0);}
37    ${CONSTRUCTING+ ___CTOR_END__ = .;}
38    ${CONSTRUCTING+ ___DTOR_LIST__ = .;}
39    ${CONSTRUCTING+ LONG((___DTOR_END__ - ___DTOR_LIST__) / 4 - 2);}
40    ${CONSTRUCTING+ *(.dtors);}
41    ${CONSTRUCTING+ LONG(0);}
42    ${CONSTRUCTING+ ___DTOR_END__ = .;}
43    ${RELOCATING+ PROVIDE(__etext = .);}
44    ${RELOCATING+ PROVIDE(_etext = .);}
45  }
46  .data ${RELOCATING:-0} : ${RELOCATING+ AT(ADDR(.text) + SIZEOF(.text))} {
47    ${RELOCATING+ PROVIDE(__data = .);}
48    *(.data);
49    *(vars);
50    ${RELOCATING+ PROVIDE(__edata = .);}
51    ${RELOCATING+ PROVIDE(_edata = .);}
52  }
53  .bss ${RELOCATING:-0} :
54  {
55    ${RELOCATING+ PROVIDE(__bss = .);}
56    *(.bss);
57    *(zerovars);
58    *(COMMON);
59    ${RELOCATING+ PROVIDE(__ebss = .);}
60    ${RELOCATING+ PROVIDE(__end = .);}
61    ${RELOCATING+ PROVIDE(_end = .);}
62    ${RELOCATING+ PROVIDE(_FreeMemStart = .);}
63  }
64  .stab 0 ${RELOCATING+(NOLOAD)} :
65  {
66    *(.stab);
67  }
68  .stabstr 0 ${RELOCATING+(NOLOAD)} :
69  {
70    *(.stabstr);
71  }
72}
73EOF
74