Fix searching a resource (#13826)
[betaflight.git] / src / link / stm32_h730_common.ld
blob2f763cde17925f28a52e11551df19efd0efccd79
2 /* Entry Point */
3 ENTRY(Reset_Handler)
5 /* Highest address of the user mode stack */
6 _estack = ORIGIN(STACKRAM) + LENGTH(STACKRAM);    /* end of RAM */
8 /* Base address where the quad spi. */
9 __octospi1_start = ORIGIN(OCTOSPI1);
10 __octospi2_start = ORIGIN(OCTOSPI2);
12 /* Generate a link error if heap and stack don't fit into RAM */
13 _Min_Heap_Size = 0;      /* required amount of heap  */
14 _Min_Stack_Size = 0x800; /* required amount of stack */
16 /* Define output sections */
17 SECTIONS
19   _isr_vector_table_flash_base = LOADADDR(.isr_vector);
20   PROVIDE (isr_vector_table_flash_base = _isr_vector_table_flash_base);
22   .isr_vector :
23   {
24     . = ALIGN(512);
25     PROVIDE (isr_vector_table_base = .);
26     KEEP(*(.isr_vector)) /* Startup code */
27     . = ALIGN(4);
28     PROVIDE (isr_vector_table_end = .);
29   } >VECTAB AT> MAIN
31   _ram_isr_vector_table_base = LOADADDR(.ram_isr_vector);
32   PROVIDE (ram_isr_vector_table_base = _ram_isr_vector_table_base);
34   .ram_isr_vector (NOLOAD) :
35   {
36     . = ALIGN(512); /* Vector table offset must be multiple of 0x200 */
37     PROVIDE (ram_isr_vector_table_base = .);
38     . += (isr_vector_table_end - isr_vector_table_base);
39     . = ALIGN(4);
40     PROVIDE (ram_isr_vector_table_end = .);
41   } >DTCM_RAM
43   /* The program code and other data goes into MAIN */
44   .text :
45   {
46     . = ALIGN(4);
47     *(.text)           /* .text sections (code) */
48     *(.text*)          /* .text* sections (code) */
49     *(.rodata)         /* .rodata sections (constants, strings, etc.) */
50     *(.rodata*)        /* .rodata* sections (constants, strings, etc.) */
51     *(.glue_7)         /* glue arm to thumb code */
52     *(.glue_7t)        /* glue thumb to arm code */
53     *(.eh_frame)
55     KEEP (*(.init))
56     KEEP (*(.fini))
58     . = ALIGN(4);
59     _etext = .;        /* define a global symbols at end of code */
60   } >MAIN
62   /* Critical program code goes into ITCM RAM */
63   /* Copy specific fast-executing code to ITCM RAM */ 
64   tcm_code = LOADADDR(.tcm_code); 
65   .tcm_code :
66   {
67     . = ALIGN(4);
68     tcm_code_start = .; 
69     *(.tcm_code)
70     *(.tcm_code*)
71     . = ALIGN(4);
72     tcm_code_end = .; 
73   } >ITCM_RAM AT >MAIN
75   .ARM.extab   : 
76   { 
77     *(.ARM.extab* .gnu.linkonce.armextab.*) 
78   } >MAIN
80   .ARM :
81   {
82     __exidx_start = .;
83     *(.ARM.exidx*) __exidx_end = .;
84   } >MAIN
86   .pg_registry :
87   {
88     PROVIDE_HIDDEN (__pg_registry_start = .);
89     KEEP (*(.pg_registry))
90     KEEP (*(SORT(.pg_registry.*)))
91     PROVIDE_HIDDEN (__pg_registry_end = .);
92   } >MAIN
94   .pg_resetdata :
95   {
96     PROVIDE_HIDDEN (__pg_resetdata_start = .);
97     KEEP (*(.pg_resetdata))
98     PROVIDE_HIDDEN (__pg_resetdata_end = .);
99   } >MAIN
101   /* used by the startup to initialize data */
102   _sidata = LOADADDR(.data);
104   /* Initialized data sections goes into RAM, load LMA copy after code */
105   .data :
106   {
107     . = ALIGN(4);
108     _sdata = .;        /* create a global symbol at data start */
109     *(.data)           /* .data sections */
110     *(.data*)          /* .data* sections */
112     . = ALIGN(4);
113     _edata = .;        /* define a global symbol at data end */
114   } >DTCM_RAM AT >MAIN
116   /* Non-critical program code goes into RAM */
117   /* Copy specific slow-executing code to RAM */
118   ram_code = LOADADDR(.ram_code);
119   .ram_code :
120   {
121     . = ALIGN(4);
122     ram_code_start = .;
123     *(.ram_code)
124     *(.ram_code*)
125     . = ALIGN(4);
126     ram_code_end = .;
127   } >RAM AT >MAIN
129   /* Uninitialized data section */
130   . = ALIGN(4);
131   .bss (NOLOAD) :
132   {
133     /* This is used by the startup in order to initialize the .bss secion */
134     _sbss = .;         /* define a global symbol at bss start */
135     __bss_start__ = _sbss;
136     *(.bss)
137     *(SORT_BY_ALIGNMENT(.bss*))
138     *(COMMON)
140     . = ALIGN(4);
141     _ebss = .;         /* define a global symbol at bss end */
142     __bss_end__ = _ebss;
143   } >RAM
145   /* Uninitialized data section */
146   . = ALIGN(4);
147   .sram2 (NOLOAD) :
148   {
149     /* This is used by the startup in order to initialize the .sram2 secion */
150     _ssram2 = .;         /* define a global symbol at sram2 start */
151     __sram2_start__ = _ssram2;
152     *(.sram2)
153     *(SORT_BY_ALIGNMENT(.sram2*))
155     . = ALIGN(4);
156     _esram2 = .;         /* define a global symbol at sram2 end */
157     __sram2_end__ = _esram2;
158   } >RAM
160   /* used during startup to initialized fastram_data */
161   _sfastram_idata = LOADADDR(.fastram_data);
163   /* Initialized FAST_DATA section for unsuspecting developers */
164   .fastram_data :
165   {
166     . = ALIGN(4);
167     _sfastram_data = .;        /* create a global symbol at data start */
168     *(.fastram_data)           /* .data sections */
169     *(.fastram_data*)          /* .data* sections */
171     . = ALIGN(4);
172     _efastram_data = .;        /* define a global symbol at data end */
173   } >FASTRAM AT >MAIN
175   . = ALIGN(4);
176   .fastram_bss (NOLOAD) :
177   {
178     _sfastram_bss = .;
179     __fastram_bss_start__ = _sfastram_bss;
180     *(.fastram_bss)
181     *(SORT_BY_ALIGNMENT(.fastram_bss*))
183     . = ALIGN(4);
184     _efastram_bss = .;
185     __fastram_bss_end__ = _efastram_bss;
186   } >FASTRAM