1*3d8817e4Smiodcat <<EOF
2*3d8817e4SmiodOUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
3*3d8817e4SmiodOUTPUT_ARCH(${ARCH})
4*3d8817e4Smiod
5*3d8817e4SmiodMEMORY
6*3d8817e4Smiod{
7*3d8817e4Smiod  text   (rx)   : ORIGIN = $ROM_START,  LENGTH = $ROM_SIZE
8*3d8817e4Smiod  data   (rwx)  : ORIGIN = $RAM_START, 	LENGTH = $RAM_SIZE
9*3d8817e4Smiod  vectors (rw)  : ORIGIN = 0xffe0,      LENGTH = 0x20
10*3d8817e4Smiod}
11*3d8817e4Smiod
12*3d8817e4SmiodSECTIONS
13*3d8817e4Smiod{
14*3d8817e4Smiod  /* Read-only sections, merged into text segment.  */
15*3d8817e4Smiod  ${TEXT_DYNAMIC+${DYNAMIC}}
16*3d8817e4Smiod  .hash        ${RELOCATING-0} : { *(.hash)             }
17*3d8817e4Smiod  .dynsym      ${RELOCATING-0} : { *(.dynsym)           }
18*3d8817e4Smiod  .dynstr      ${RELOCATING-0} : { *(.dynstr)           }
19*3d8817e4Smiod  .gnu.version ${RELOCATING-0} : { *(.gnu.version)      }
20*3d8817e4Smiod  .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d)  }
21*3d8817e4Smiod  .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r)  }
22*3d8817e4Smiod
23*3d8817e4Smiod  .rel.init    ${RELOCATING-0} : { *(.rel.init) }
24*3d8817e4Smiod  .rela.init   ${RELOCATING-0} : { *(.rela.init)        }
25*3d8817e4Smiod  .rel.text    ${RELOCATING-0} :
26*3d8817e4Smiod    {
27*3d8817e4Smiod      *(.rel.text)
28*3d8817e4Smiod      ${RELOCATING+*(.rel.text.*)}
29*3d8817e4Smiod      ${RELOCATING+*(.rel.gnu.linkonce.t*)}
30*3d8817e4Smiod    }
31*3d8817e4Smiod  .rela.text   ${RELOCATING-0} :
32*3d8817e4Smiod    {
33*3d8817e4Smiod      *(.rela.text)
34*3d8817e4Smiod      ${RELOCATING+*(.rela.text.*)}
35*3d8817e4Smiod      ${RELOCATING+*(.rela.gnu.linkonce.t*)}
36*3d8817e4Smiod    }
37*3d8817e4Smiod  .rel.fini    ${RELOCATING-0} : { *(.rel.fini) }
38*3d8817e4Smiod  .rela.fini   ${RELOCATING-0} : { *(.rela.fini)        }
39*3d8817e4Smiod  .rel.rodata  ${RELOCATING-0} :
40*3d8817e4Smiod    {
41*3d8817e4Smiod      *(.rel.rodata)
42*3d8817e4Smiod      ${RELOCATING+*(.rel.rodata.*)}
43*3d8817e4Smiod      ${RELOCATING+*(.rel.gnu.linkonce.r*)}
44*3d8817e4Smiod    }
45*3d8817e4Smiod  .rela.rodata ${RELOCATING-0} :
46*3d8817e4Smiod    {
47*3d8817e4Smiod      *(.rela.rodata)
48*3d8817e4Smiod      ${RELOCATING+*(.rela.rodata.*)}
49*3d8817e4Smiod      ${RELOCATING+*(.rela.gnu.linkonce.r*)}
50*3d8817e4Smiod    }
51*3d8817e4Smiod  .rel.data    ${RELOCATING-0} :
52*3d8817e4Smiod    {
53*3d8817e4Smiod      *(.rel.data)
54*3d8817e4Smiod      ${RELOCATING+*(.rel.data.*)}
55*3d8817e4Smiod      ${RELOCATING+*(.rel.gnu.linkonce.d*)}
56*3d8817e4Smiod    }
57*3d8817e4Smiod  .rela.data   ${RELOCATING-0} :
58*3d8817e4Smiod    {
59*3d8817e4Smiod      *(.rela.data)
60*3d8817e4Smiod      ${RELOCATING+*(.rela.data.*)}
61*3d8817e4Smiod      ${RELOCATING+*(.rela.gnu.linkonce.d*)}
62*3d8817e4Smiod    }
63*3d8817e4Smiod  .rel.ctors   ${RELOCATING-0} : { *(.rel.ctors)        }
64*3d8817e4Smiod  .rela.ctors  ${RELOCATING-0} : { *(.rela.ctors)       }
65*3d8817e4Smiod  .rel.dtors   ${RELOCATING-0} : { *(.rel.dtors)        }
66*3d8817e4Smiod  .rela.dtors  ${RELOCATING-0} : { *(.rela.dtors)       }
67*3d8817e4Smiod  .rel.got     ${RELOCATING-0} : { *(.rel.got)          }
68*3d8817e4Smiod  .rela.got    ${RELOCATING-0} : { *(.rela.got)         }
69*3d8817e4Smiod  .rel.bss     ${RELOCATING-0} : { *(.rel.bss)          }
70*3d8817e4Smiod  .rela.bss    ${RELOCATING-0} : { *(.rela.bss)         }
71*3d8817e4Smiod  .rel.plt     ${RELOCATING-0} : { *(.rel.plt)          }
72*3d8817e4Smiod  .rela.plt    ${RELOCATING-0} : { *(.rela.plt)         }
73*3d8817e4Smiod
74*3d8817e4Smiod  /* Internal text space.  */
75*3d8817e4Smiod  .text :
76*3d8817e4Smiod  {
77*3d8817e4Smiod    ${RELOCATING+. = ALIGN(2);}
78*3d8817e4Smiod    *(.init)
79*3d8817e4Smiod    *(.init0)  /* Start here after reset.  */
80*3d8817e4Smiod    *(.init1)
81*3d8817e4Smiod    *(.init2)
82*3d8817e4Smiod    *(.init3)
83*3d8817e4Smiod    *(.init4)
84*3d8817e4Smiod    *(.init5)
85*3d8817e4Smiod    *(.init6)  /* C++ constructors.  */
86*3d8817e4Smiod    *(.init7)
87*3d8817e4Smiod    *(.init8)
88*3d8817e4Smiod    *(.init9)  /* Call main().  */
89*3d8817e4Smiod
90*3d8817e4Smiod    ${CONSTRUCTING+ __ctors_start = . ; }
91*3d8817e4Smiod    ${CONSTRUCTING+ *(.ctors) }
92*3d8817e4Smiod    ${CONSTRUCTING+ __ctors_end = . ; }
93*3d8817e4Smiod    ${CONSTRUCTING+ __dtors_start = . ; }
94*3d8817e4Smiod    ${CONSTRUCTING+ *(.dtors) }
95*3d8817e4Smiod    ${CONSTRUCTING+ __dtors_end = . ; }
96*3d8817e4Smiod
97*3d8817e4Smiod    ${RELOCATING+. = ALIGN(2);}
98*3d8817e4Smiod    *(.text)
99*3d8817e4Smiod    ${RELOCATING+. = ALIGN(2);}
100*3d8817e4Smiod    *(.text.*)
101*3d8817e4Smiod
102*3d8817e4Smiod    ${RELOCATING+. = ALIGN(2);}
103*3d8817e4Smiod    *(.fini9)
104*3d8817e4Smiod    *(.fini8)
105*3d8817e4Smiod    *(.fini7)
106*3d8817e4Smiod    *(.fini6)  /* C++ destructors.  */
107*3d8817e4Smiod    *(.fini5)
108*3d8817e4Smiod    *(.fini4)
109*3d8817e4Smiod    *(.fini3)
110*3d8817e4Smiod    *(.fini2)
111*3d8817e4Smiod    *(.fini1)
112*3d8817e4Smiod    *(.fini0)  /* Infinite loop after program termination.  */
113*3d8817e4Smiod    *(.fini)
114*3d8817e4Smiod
115*3d8817e4Smiod    ${RELOCATING+ _etext = . ; }
116*3d8817e4Smiod  } ${RELOCATING+ > text}
117*3d8817e4Smiod
118*3d8817e4Smiod  .data ${RELOCATING-0} : ${RELOCATING+AT (ADDR (.text) + SIZEOF (.text))}
119*3d8817e4Smiod  {
120*3d8817e4Smiod    ${RELOCATING+ PROVIDE (__data_start = .) ; }
121*3d8817e4Smiod    *(.data)
122*3d8817e4Smiod    *(.gnu.linkonce.d*)
123*3d8817e4Smiod    ${RELOCATING+. = ALIGN(2);}
124*3d8817e4Smiod    ${RELOCATING+ _edata = . ; }
125*3d8817e4Smiod  } ${RELOCATING+ > data}
126*3d8817e4Smiod
127*3d8817e4Smiod  .bss ${RELOCATING+ SIZEOF(.data) + ADDR(.data)} :
128*3d8817e4Smiod  {
129*3d8817e4Smiod    ${RELOCATING+ PROVIDE (__bss_start = .) ; }
130*3d8817e4Smiod    *(.bss)
131*3d8817e4Smiod    *(COMMON)
132*3d8817e4Smiod    ${RELOCATING+ PROVIDE (__bss_end = .) ; }
133*3d8817e4Smiod    ${RELOCATING+ _end = . ;  }
134*3d8817e4Smiod  } ${RELOCATING+ > data}
135*3d8817e4Smiod
136*3d8817e4Smiod  .noinit ${RELOCATING+ SIZEOF(.bss) + ADDR(.bss)} :
137*3d8817e4Smiod  {
138*3d8817e4Smiod    ${RELOCATING+ PROVIDE (__noinit_start = .) ; }
139*3d8817e4Smiod    *(.noinit)
140*3d8817e4Smiod    *(COMMON)
141*3d8817e4Smiod    ${RELOCATING+ PROVIDE (__noinit_end = .) ; }
142*3d8817e4Smiod    ${RELOCATING+ _end = . ;  }
143*3d8817e4Smiod  } ${RELOCATING+ > data}
144*3d8817e4Smiod
145*3d8817e4Smiod  .vectors ${RELOCATING-0}:
146*3d8817e4Smiod  {
147*3d8817e4Smiod    ${RELOCATING+ PROVIDE (__vectors_start = .) ; }
148*3d8817e4Smiod    *(.vectors*)
149*3d8817e4Smiod    ${RELOCATING+ _vectors_end = . ; }
150*3d8817e4Smiod  } ${RELOCATING+ > vectors}
151*3d8817e4Smiod
152*3d8817e4Smiod  /* Stabs debugging sections.  */
153*3d8817e4Smiod  .stab 0 : { *(.stab) }
154*3d8817e4Smiod  .stabstr 0 : { *(.stabstr) }
155*3d8817e4Smiod  .stab.excl 0 : { *(.stab.excl) }
156*3d8817e4Smiod  .stab.exclstr 0 : { *(.stab.exclstr) }
157*3d8817e4Smiod  .stab.index 0 : { *(.stab.index) }
158*3d8817e4Smiod  .stab.indexstr 0 : { *(.stab.indexstr) }
159*3d8817e4Smiod  .comment 0 : { *(.comment) }
160*3d8817e4Smiod
161*3d8817e4Smiod  /* DWARF debug sections.
162*3d8817e4Smiod     Symbols in the DWARF debugging sections are relative to the beginning
163*3d8817e4Smiod     of the section so we begin them at 0.  */
164*3d8817e4Smiod
165*3d8817e4Smiod  /* DWARF 1 */
166*3d8817e4Smiod  .debug          0 : { *(.debug) }
167*3d8817e4Smiod  .line           0 : { *(.line) }
168*3d8817e4Smiod
169*3d8817e4Smiod  /* GNU DWARF 1 extensions */
170*3d8817e4Smiod  .debug_srcinfo  0 : { *(.debug_srcinfo) }
171*3d8817e4Smiod  .debug_sfnames  0 : { *(.debug_sfnames) }
172*3d8817e4Smiod
173*3d8817e4Smiod  /* DWARF 1.1 and DWARF 2 */
174*3d8817e4Smiod  .debug_aranges  0 : { *(.debug_aranges) }
175*3d8817e4Smiod  .debug_pubnames 0 : { *(.debug_pubnames) }
176*3d8817e4Smiod
177*3d8817e4Smiod  /* DWARF 2 */
178*3d8817e4Smiod  .debug_info     0 : { *(.debug_info) *(.gnu.linkonce.wi.*) }
179*3d8817e4Smiod  .debug_abbrev   0 : { *(.debug_abbrev) }
180*3d8817e4Smiod  .debug_line     0 : { *(.debug_line) }
181*3d8817e4Smiod  .debug_frame    0 : { *(.debug_frame) }
182*3d8817e4Smiod  .debug_str      0 : { *(.debug_str) }
183*3d8817e4Smiod  .debug_loc      0 : { *(.debug_loc) }
184*3d8817e4Smiod  .debug_macinfo  0 : { *(.debug_macinfo) }
185*3d8817e4Smiod
186*3d8817e4Smiod  PROVIDE (__stack = ${STACK}) ;
187*3d8817e4Smiod  PROVIDE (__data_start_rom = _etext) ;
188*3d8817e4Smiod  PROVIDE (__data_end_rom   = _etext + SIZEOF (.data)) ;
189*3d8817e4Smiod  PROVIDE (__noinit_start_rom = _etext + SIZEOF (.data)) ;
190*3d8817e4Smiod  PROVIDE (__noinit_end_rom = _etext + SIZEOF (.data) + SIZEOF (.noinit)) ;
191*3d8817e4Smiod}
192*3d8817e4SmiodEOF
193