]> begriffs open source - cmsis-freertos/blob - Demo/RISC-V_Renode_Emulator_SoftConsole/microsemi-riscv-renode.ld
Update README.md - branch main is now the base branch
[cmsis-freertos] / Demo / RISC-V_Renode_Emulator_SoftConsole / microsemi-riscv-renode.ld
1 /*******************************************************************************
2  * (c) Copyright 2016-2018 Microsemi SoC Products Group.  All rights reserved.
3  *
4  * file name : microsemi-riscv-ram.ld
5  * Mi-V soft processor linker script for creating a SoftConsole downloadable
6  * debug image executing in SRAM.
7  *
8  * This linker script assumes that the SRAM is connected at on the Mi-V soft
9  * processor memory space. The start address and size of the memory space must
10  * be correct as per the Libero design.
11  *
12  * SVN $Revision: 9661 $
13  * SVN $Date: 2018-01-15 16:13:33 +0530 (Mon, 15 Jan 2018) $
14  */
15
16 OUTPUT_ARCH( "riscv" )
17 ENTRY(_start)
18
19
20 MEMORY
21 {
22     ram (rwx) : ORIGIN = 0x80000000, LENGTH = 512k
23 }
24
25 RAM_START_ADDRESS   = 0x80000000;       /* Must be the same value MEMORY region ram ORIGIN above. */
26 RAM_SIZE            = 512k;              /* Must be the same value MEMORY region ram LENGTH above. */
27 STACK_SIZE          = 2k;               /* needs to be calculated for your application */
28 HEAP_SIZE           = 4;               /* needs to be calculated for your application */
29
30 SECTIONS
31 {
32   .text : ALIGN(0x10)
33   {
34     KEEP (*(SORT_NONE(.text.entry)))
35     . = ALIGN(0x10);
36     *(.text .text.* .gnu.linkonce.t.*)
37     *(.plt)
38     . = ALIGN(0x10);
39
40     KEEP (*crtbegin.o(.ctors))
41     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
42     KEEP (*(SORT(.ctors.*)))
43     KEEP (*crtend.o(.ctors))
44     KEEP (*crtbegin.o(.dtors))
45     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
46     KEEP (*(SORT(.dtors.*)))
47     KEEP (*crtend.o(.dtors))
48
49     *(.rodata .rodata.* .gnu.linkonce.r.*)
50     *(.gcc_except_table)
51     *(.eh_frame_hdr)
52     *(.eh_frame)
53
54     KEEP (*(.init))
55     KEEP (*(.fini))
56
57     PROVIDE_HIDDEN (__preinit_array_start = .);
58     KEEP (*(.preinit_array))
59     PROVIDE_HIDDEN (__preinit_array_end = .);
60     PROVIDE_HIDDEN (__init_array_start = .);
61     KEEP (*(SORT(.init_array.*)))
62     KEEP (*(.init_array))
63     PROVIDE_HIDDEN (__init_array_end = .);
64     PROVIDE_HIDDEN (__fini_array_start = .);
65     KEEP (*(.fini_array))
66     KEEP (*(SORT(.fini_array.*)))
67     PROVIDE_HIDDEN (__fini_array_end = .);
68     . = ALIGN(0x10);
69
70   } > ram
71
72   /* short/global data section */
73   .sdata : ALIGN(0x10)
74   {
75     __sdata_load = LOADADDR(.sdata);
76     __sdata_start = .;
77     PROVIDE( __global_pointer$ = . + 0x800);
78     *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2)
79     *(.srodata*)
80     *(.sdata .sdata.* .gnu.linkonce.s.*)
81     . = ALIGN(0x10);
82     __sdata_end = .;
83   } > ram
84
85   /* data section */
86   .data : ALIGN(0x10)
87   {
88     __data_load = LOADADDR(.data);
89     __data_start = .;
90     *(.got.plt) *(.got)
91     *(.shdata)
92     *(.data .data.* .gnu.linkonce.d.*)
93     . = ALIGN(0x10);
94     __data_end = .;
95   } > ram
96
97   /* sbss section */
98   .sbss : ALIGN(0x10)
99   {
100     __sbss_start = .;
101     *(.sbss .sbss.* .gnu.linkonce.sb.*)
102     *(.scommon)
103     . = ALIGN(0x10);
104     __sbss_end = .;
105   } > ram
106
107   /* sbss section */
108   .bss : ALIGN(0x10)
109   {
110     __bss_start = .;
111     *(.shbss)
112     *(.bss .bss.* .gnu.linkonce.b.*)
113     *(COMMON)
114     . = ALIGN(0x10);
115     __bss_end = .;
116   } > ram
117
118   /* End of uninitialized data segment */
119   _end = .;
120
121   .heap : ALIGN(0x10)
122   {
123     __heap_start = .;
124     . += HEAP_SIZE;
125     __heap_end = .;
126     . = ALIGN(0x10);
127     _heap_end = __heap_end;
128   } > ram
129
130   .stack : ALIGN(0x10)
131   {
132     __stack_bottom = .;
133     . += STACK_SIZE;
134     __stack_top = .;
135     _sp = .;
136         __freertos_irq_stack_top = .;
137   } > ram
138 }
139