1 OUTPUT_ARCH( "riscv" )
\r
7 flash (rxai!w) : ORIGIN = 0x20400000, LENGTH = 512M
\r
8 ram (wxa!ri) : ORIGIN = 0x80000000, LENGTH = 16K
\r
20 __stack_size = DEFINED(__stack_size) ? __stack_size : 2K;
\r
24 KEEP (*(SORT_NONE(.init)))
\r
25 } >flash AT>flash :flash
\r
29 *(.text.unlikely .text.unlikely.*)
\r
30 *(.text.startup .text.startup.*)
\r
32 *(.gnu.linkonce.t.*)
\r
33 } >flash AT>flash :flash
\r
37 KEEP (*(SORT_NONE(.fini)))
\r
38 } >flash AT>flash :flash
\r
40 PROVIDE (__etext = .);
\r
41 PROVIDE (_etext = .);
\r
42 PROVIDE (etext = .);
\r
48 PROVIDE_HIDDEN (__preinit_array_start = .);
\r
49 KEEP (*(.preinit_array))
\r
50 PROVIDE_HIDDEN (__preinit_array_end = .);
\r
51 } >flash AT>flash :flash
\r
55 PROVIDE_HIDDEN (__init_array_start = .);
\r
56 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
\r
57 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
\r
58 PROVIDE_HIDDEN (__init_array_end = .);
\r
59 } >flash AT>flash :flash
\r
63 PROVIDE_HIDDEN (__fini_array_start = .);
\r
64 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
\r
65 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
\r
66 PROVIDE_HIDDEN (__fini_array_end = .);
\r
67 } >flash AT>flash :flash
\r
71 /* gcc uses crtbegin.o to find the start of
\r
72 the constructors, so we make sure it is
\r
73 first. Because this is a wildcard, it
\r
74 doesn't matter if the user does not
\r
75 actually link against crtbegin.o; the
\r
76 linker won't look for a file to match a
\r
77 wildcard. The wildcard also means that it
\r
78 doesn't matter which directory crtbegin.o
\r
80 KEEP (*crtbegin.o(.ctors))
\r
81 KEEP (*crtbegin?.o(.ctors))
\r
82 /* We don't want to include the .ctor section from
\r
83 the crtend.o file until after the sorted ctors.
\r
84 The .ctor section from the crtend file contains the
\r
85 end of ctors marker and it must be last */
\r
86 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
\r
87 KEEP (*(SORT(.ctors.*)))
\r
89 } >flash AT>flash :flash
\r
93 KEEP (*crtbegin.o(.dtors))
\r
94 KEEP (*crtbegin?.o(.dtors))
\r
95 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
\r
96 KEEP (*(SORT(.dtors.*)))
\r
98 } >flash AT>flash :flash
\r
103 PROVIDE( _data_lma = . );
\r
104 } >flash AT>flash :flash
\r
109 PROVIDE( _data = . );
\r
110 } >ram AT>flash :ram_init
\r
115 *(.rodata .rodata.*)
\r
116 *(.gnu.linkonce.r.*)
\r
118 *(.gnu.linkonce.d.*)
\r
120 PROVIDE( __global_pointer$ = . + 0x800 );
\r
122 *(.gnu.linkonce.s.*)
\r
128 *(.srodata .srodata.*)
\r
129 } >ram AT>flash :ram_init
\r
132 PROVIDE( _edata = . );
\r
133 PROVIDE( edata = . );
\r
135 PROVIDE( _fbss = . );
\r
136 PROVIDE( __bss_start = . );
\r
140 *(.gnu.linkonce.sb.*)
\r
142 *(.gnu.linkonce.b.*)
\r
148 PROVIDE( _end = . );
\r
149 PROVIDE( end = . );
\r
151 .stack ORIGIN(ram) + LENGTH(ram) - __stack_size :
\r
153 PROVIDE( _heap_end = . );
\r
155 PROVIDE( _sp = . );
\r