1 /* Copyright 2019 SiFive, Inc */
2 /* SPDX-License-Identifier: Apache-2.0 */
3 /* ----------------------------------- */
4 /* ----------------------------------- */
12 ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 0x4000
13 flash (rxai!w) : ORIGIN = 0x20010000, LENGTH = 0x6a120
27 __stack_size = DEFINED(__stack_size) ? __stack_size : 0x400;
28 PROVIDE(__stack_size = __stack_size);
29 __heap_size = DEFINED(__heap_size) ? __heap_size : 0x4;
30 PROVIDE(__metal_boot_hart = 0);
31 PROVIDE(__metal_chicken_bit = 0);
36 KEEP (*(.text.metal.init.enter))
37 KEEP (*(SORT_NONE(.init)))
38 KEEP (*(.text.libgloss.start))
39 } >flash AT>flash :flash
44 *(.text.unlikely .text.unlikely.*)
45 *(.text.startup .text.startup.*)
49 } >flash AT>flash :flash
54 KEEP (*(SORT_NONE(.fini)))
55 } >flash AT>flash :flash
58 PROVIDE (__etext = .);
73 *(.srodata .srodata.*)
74 } >flash AT>flash :flash
82 PROVIDE_HIDDEN (__preinit_array_start = .);
83 KEEP (*(.preinit_array))
84 PROVIDE_HIDDEN (__preinit_array_end = .);
85 } >flash AT>flash :flash
90 PROVIDE_HIDDEN (__init_array_start = .);
91 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
92 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
93 PROVIDE_HIDDEN (__init_array_end = .);
94 } >flash AT>flash :flash
99 PROVIDE_HIDDEN (__fini_array_start = .);
100 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
101 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
102 PROVIDE_HIDDEN (__fini_array_end = .);
103 } >flash AT>flash :flash
108 /* gcc uses crtbegin.o to find the start of
109 the constructors, so we make sure it is
110 first. Because this is a wildcard, it
111 doesn't matter if the user does not
112 actually link against crtbegin.o; the
113 linker won't look for a file to match a
114 wildcard. The wildcard also means that it
115 doesn't matter which directory crtbegin.o
117 KEEP (*crtbegin.o(.ctors))
118 KEEP (*crtbegin?.o(.ctors))
119 /* We don't want to include the .ctor section from
120 the crtend.o file until after the sorted ctors.
121 The .ctor section from the crtend file contains the
122 end of ctors marker and it must be last */
123 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
124 KEEP (*(SORT(.ctors.*)))
126 } >flash AT>flash :flash
131 KEEP (*crtbegin.o(.dtors))
132 KEEP (*crtbegin?.o(.dtors))
133 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
134 KEEP (*(SORT(.dtors.*)))
136 } >flash AT>flash :flash
142 PROVIDE( metal_segment_itim_source_start = . );
143 } >flash AT>flash :flash
149 PROVIDE( metal_segment_itim_target_start = . );
150 } >ram AT>flash :ram_init
156 } >flash AT>flash :flash
160 PROVIDE( metal_segment_itim_target_end = . );
166 PROVIDE( _data_lma = . );
167 PROVIDE( metal_segment_data_source_start = . );
168 } >flash AT>flash :flash
174 PROVIDE( metal_segment_data_target_start = . );
175 } >ram AT>flash :ram_init
183 PROVIDE( __global_pointer$ = . + 0x800 );
184 *(.sdata .sdata.* .sdata2.*)
186 } >ram AT>flash :ram_init
190 PROVIDE( _edata = . );
191 PROVIDE( edata = . );
192 PROVIDE( metal_segment_data_target_end = . );
193 PROVIDE( _fbss = . );
194 PROVIDE( __bss_start = . );
195 PROVIDE( metal_segment_bss_target_start = . );
201 *(.gnu.linkonce.sb.*)
212 PROVIDE( metal_segment_bss_target_end = . );
217 metal_segment_stack_begin = .;
221 PROVIDE(metal_segment_stack_end = .);
222 __freertos_irq_stack_top = .;
228 PROVIDE( metal_segment_heap_target_start = . );
230 PROVIDE( metal_segment_heap_target_end = . );
231 PROVIDE( _heap_end = . );