1///////////////////////////////////////////////////////////////////////////////
2// RISC-V ilink configuration file.
3//
4
5define exported symbol _link_file_version_2 = 1;
6define exported symbol _auto_vector_setup = 1;
7define exported symbol _max_vector = 16;
8define exported symbol _CLINT = 1;
9
10define memory mem with size = 4G;
11
12define region RAM_region32 = mem:[from 0x80000000 to 0x8003FFFF];
13define region ROM_region32 = mem:[from 0x20000000 to 0x3FFFFFFF];
14
15initialize by copy { rw };
16do not initialize  { section *.noinit };
17
18define block CSTACK with alignment = 16, size = CSTACK_SIZE { };
19define block HEAP   with alignment = 16, size = HEAP_SIZE   { };
20
21define block MVECTOR with alignment = 128 { ro section .mintvec };
22
23if (isdefinedsymbol(_uses_clic))
24{
25  define block MINTERRUPT with alignment = 128 { ro section .mtext };
26  define block MINTERRUPTS { block MVECTOR,
27                             block MINTERRUPT };
28}
29else
30{
31  define block MINTERRUPTS with maximum size =  64k { ro section .mtext,
32                                                      midway block MVECTOR };
33}
34
35define block RW_DATA with static base GPREL { rw data };
36keep symbol __iar_cstart_init_gp; // defined in cstartup.s
37
38"CSTARTUP32" : place at start of ROM_region32 { ro section .cstartup };
39
40"ROM32":place in ROM_region32        { ro,
41                                       block MINTERRUPTS };
42
43"RAM32":place in RAM_region32        { block RW_DATA,
44                                       block HEAP,
45                                       block CSTACK };
46
47"RAM32":place in RAM_region32 { last section FREE_MEM};
48