2 OUTPUT_FORMAT("${OUTPUT_FORMAT}","${OUTPUT_FORMAT}","${OUTPUT_FORMAT}")
7 imem (x) : ORIGIN = $TEXT_ORIGIN, LENGTH = $TEXT_LENGTH
8 dmem (rw!x) : ORIGIN = $DATA_ORIGIN, LENGTH = $DATA_LENGTH
11 __HEAP_SIZE = DEFINED(__HEAP_SIZE) ? __HEAP_SIZE : 32;
12 __STACK_SIZE = DEFINED(__STACK_SIZE) ? __STACK_SIZE : 512;
14 ${RELOCATING+ PROVIDE (_stack_top = ORIGIN(dmem) + LENGTH(dmem)) ; }
16 ${RELOCATING+ENTRY (_start)}
20 /* Read-only sections, merged into text segment: */
21 ${TEXT_DYNAMIC+${DYNAMIC}}
22 .hash ${RELOCATING-0} : { *(.hash) }
23 .dynsym ${RELOCATING-0} : { *(.dynsym) }
24 .dynstr ${RELOCATING-0} : { *(.dynstr) }
25 .gnu.version ${RELOCATING-0} : { *(.gnu.version) }
26 .gnu.version_d ${RELOCATING-0} : { *(.gnu.version_d) }
27 .gnu.version_r ${RELOCATING-0} : { *(.gnu.version_r) }
29 .rel.init ${RELOCATING-0} : { *(.rel.init) }
30 .rela.init ${RELOCATING-0} : { *(.rela.init) }
31 .rel.text ${RELOCATING-0} :
34 ${RELOCATING+*(.rel.text.*)}
35 ${RELOCATING+*(.rel.text:*)}
36 ${RELOCATING+*(.rel.gnu.linkonce.t*)}
38 .rela.text ${RELOCATING-0} :
41 ${RELOCATING+*(.rela.text.*)}
42 ${RELOCATING+*(.rela.text:*)}
43 ${RELOCATING+*(.rela.gnu.linkonce.t*)}
45 .rel.fini ${RELOCATING-0} : { *(.rel.fini) }
46 .rela.fini ${RELOCATING-0} : { *(.rela.fini) }
47 .rel.rodata ${RELOCATING-0} :
50 ${RELOCATING+*(.rel.rodata.*)}
51 ${RELOCATING+*(.rel.rodata:*)}
52 ${RELOCATING+*(.rel.gnu.linkonce.r*)}
54 .rela.rodata ${RELOCATING-0} :
57 ${RELOCATING+*(.rela.rodata.*)}
58 ${RELOCATING+*(.rela.rodata:*)}
59 ${RELOCATING+*(.rela.gnu.linkonce.r*)}
61 .rel.data ${RELOCATING-0} :
64 ${RELOCATING+*(.rel.data.*)}
65 ${RELOCATING+*(.rel.data:*)}
66 ${RELOCATING+*(.rel.gnu.linkonce.d*)}
68 .rela.data ${RELOCATING-0} :
71 ${RELOCATING+*(.rela.data.*)}
72 ${RELOCATING+*(.rela.data:*)}
73 ${RELOCATING+*(.rela.gnu.linkonce.d*)}
75 .rel.init_array ${RELOCATING-0} : { *(.rel.init_array) }
76 .rela.init_array ${RELOCATING-0} : { *(.rela.init_array) }
77 .rel.fini_array ${RELOCATING-0} : { *(.rel.fini_array) }
78 .rela.fini_array ${RELOCATING-0} : { *(.rela.fini_array) }
79 .rel.got ${RELOCATING-0} : { *(.rel.got) }
80 .rela.got ${RELOCATING-0} : { *(.rela.got) }
81 .rel.bss ${RELOCATING-0} : { *(.rel.bss) }
82 .rela.bss ${RELOCATING-0} : { *(.rela.bss) }
83 .rel.plt ${RELOCATING-0} : { *(.rel.plt) }
84 .rela.plt ${RELOCATING-0} : { *(.rela.plt) }
86 /* Internal text space. */
87 .text ${RELOCATING-0} :
89 ${RELOCATING+ _text_start = . ; }
91 ${RELOCATING+. = ALIGN(4);}
93 ${RELOCATING+*(.init0) /* Start here after reset. */}
94 ${RELOCATING+KEEP (*(.init0))}
96 ${RELOCATING+. = ALIGN(4);}
98 ${RELOCATING+. = ALIGN(4);}
99 ${RELOCATING+*(.text.*)}
100 ${RELOCATING+. = ALIGN(4);}
101 ${RELOCATING+*(.text:*)}
102 ${RELOCATING+. = ALIGN(4);}
103 ${RELOCATING+*(.gnu.linkonce.t*)}
104 ${RELOCATING+. = ALIGN(4);}
106 ${RELOCATING+ _text_end = . ; }
107 } ${RELOCATING+ > imem}
109 .data ${RELOCATING-0} :
111 /* Optional variable that user is prepared to have NULL address. */
112 ${RELOCATING+ *(.data.atzero*)}
114 /* CRT is prepared for constructor/destructor table to have
115 a "valid" NULL address. */
116 ${CONSTRUCTING+ __init_array_begin = . ; }
117 ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)))}
118 ${CONSTRUCTING+ KEEP (*(.init_array))}
119 ${CONSTRUCTING+ __init_array_end = . ; }
120 ${CONSTRUCTING+ __fini_array_begin = . ; }
121 ${CONSTRUCTING+ KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*)))}
122 ${CONSTRUCTING+ KEEP (*(.fini_array))}
123 ${CONSTRUCTING+ __fini_array_end = . ; }
125 /* DATA memory starts at address 0. So to avoid placing a valid static
126 variable at the invalid NULL address, we introduce the .data.atzero
127 section. If CRT can make some use of it - great. Otherwise skip a
128 word. In all cases .data/.bss sections must start at non-zero. */
129 . += (. == 0 ? 4 : 0);
131 ${RELOCATING+ PROVIDE (_data_start = .) ; }
133 ${RELOCATING+ *(.data*)}
134 ${RELOCATING+ *(.data:*)}
135 ${RELOCATING+ *(.rodata) /* We need to include .rodata here if gcc is used. */}
136 ${RELOCATING+ *(.rodata.*) /* with -fdata-sections. */}
137 ${RELOCATING+ *(.rodata:*)}
138 ${RELOCATING+*(.gnu.linkonce.d*)}
139 ${RELOCATING+*(.gnu.linkonce.r*)}
140 ${RELOCATING+. = ALIGN(4);}
141 ${RELOCATING+ PROVIDE (_data_end = .) ; }
142 } ${RELOCATING+ > dmem }
144 .resource_table ${RELOCATING-0} :
147 KEEP (*(.resource_table))
150 .bss ${RELOCATING-0} :
152 ${RELOCATING+ PROVIDE (_bss_start = .) ; }
154 ${RELOCATING+ *(.bss.*)}
155 ${RELOCATING+ *(.bss:*)}
156 ${RELOCATING+*(.gnu.linkonce.b*)}
158 ${RELOCATING+ PROVIDE (_bss_end = .) ; }
159 } ${RELOCATING+ > dmem}
161 /* Global data not cleared after reset. */
162 .noinit ${RELOCATING-0}:
164 ${RELOCATING+ PROVIDE (_noinit_start = .) ; }
166 ${RELOCATING+ PROVIDE (_noinit_end = .) ; }
167 ${RELOCATING+ PROVIDE (_heap_start = .) ; }
168 ${RELOCATING+ . += __HEAP_SIZE ; }
169 /* Stack is not here really. It will be put at the end of DMEM.
170 But we take into account its size here, in order to allow
171 for MEMORY overflow checking during link time. */
172 ${RELOCATING+ . += __STACK_SIZE ; }
173 } ${RELOCATING+ > dmem}
175 /* Stabs debugging sections. */
176 .stab 0 : { *(.stab) }
177 .stabstr 0 : { *(.stabstr) }
178 .stab.excl 0 : { *(.stab.excl) }
179 .stab.exclstr 0 : { *(.stab.exclstr) }
180 .stab.index 0 : { *(.stab.index) }
181 .stab.indexstr 0 : { *(.stab.indexstr) }
182 .comment 0 : { *(.comment) }
183 .note.gnu.build-id : { *(.note.gnu.build-id) }
186 . $srcdir/scripttempl/DWARF.sc