1/*
2 * linker script for STM32H7S7L8HxH with GNU ld
3 */
4
5/* Program Entry, set to mark it as "used" and avoid gc */
6MEMORY
7{
8ROM (rx) : ORIGIN =0x70000000,LENGTH =65536K
9RAM (rw) : ORIGIN =0x24000000,LENGTH =455K
10ITCM (rwx)      : ORIGIN = 0x00000000, LENGTH = 64K
11}
12ENTRY(Reset_Handler)
13_system_stack_size = 0x400;
14
15SECTIONS
16{
17    .text :
18    {
19        . = ALIGN(4);
20        _stext = .;
21        KEEP(*(.isr_vector))            /* Startup code */
22
23        . = ALIGN(4);
24        *(.text)                        /* remaining code */
25        *(.text.*)                      /* remaining code */
26        *(.rodata)                      /* read-only data (constants) */
27        *(.rodata*)
28        *(.glue_7)
29        *(.glue_7t)
30        *(.gnu.linkonce.t*)
31
32        /* section information for finsh shell */
33        . = ALIGN(4);
34        __fsymtab_start = .;
35        KEEP(*(FSymTab))
36        __fsymtab_end = .;
37
38        . = ALIGN(4);
39        __vsymtab_start = .;
40        KEEP(*(VSymTab))
41        __vsymtab_end = .;
42
43        /* section information for utest */
44        . = ALIGN(4);
45        __rt_utest_tc_tab_start = .;
46        KEEP(*(UtestTcTab))
47        __rt_utest_tc_tab_end = .;
48
49        /* section information for at server */
50        . = ALIGN(4);
51        __rtatcmdtab_start = .;
52        KEEP(*(RtAtCmdTab))
53        __rtatcmdtab_end = .;
54        . = ALIGN(4);
55
56        /* section information for modules */
57        . = ALIGN(4);
58        __rtmsymtab_start = .;
59        KEEP(*(RTMSymTab))
60        __rtmsymtab_end = .;
61
62        /* section information for initial. */
63        . = ALIGN(4);
64        __rt_init_start = .;
65        KEEP(*(SORT(.rti_fn*)))
66        __rt_init_end = .;
67
68        . = ALIGN(4);
69
70        PROVIDE(__ctors_start__ = .);
71        KEEP (*(SORT(.init_array.*)))
72        KEEP (*(.init_array))
73        PROVIDE(__ctors_end__ = .);
74
75        . = ALIGN(4);
76
77        _etext = .;
78    } > ROM = 0
79
80    /* .ARM.exidx is sorted, so has to go in its own output section.  */
81    __exidx_start = .;
82    .ARM.exidx :
83    {
84        *(.ARM.exidx* .gnu.linkonce.armexidx.*)
85
86        /* This is used by the startup in order to initialize the .data secion */
87        _sidata = .;
88    } > ROM
89    __exidx_end = .;
90
91    /* .data section which is used for initialized data */
92
93    .data : AT (_sidata)
94    {
95        . = ALIGN(4);
96        /* This is used by the startup in order to initialize the .data secion */
97        _sdata = . ;
98
99        *(.data)
100        *(.data.*)
101        *(.gnu.linkonce.d*)
102
103
104        PROVIDE(__dtors_start__ = .);
105        KEEP(*(SORT(.dtors.*)))
106        KEEP(*(.dtors))
107        PROVIDE(__dtors_end__ = .);
108
109        . = ALIGN(4);
110        /* This is used by the startup in order to initialize the .data secion */
111        _edata = . ;
112    } >RAM
113
114    .stack :
115    {
116        . = ALIGN(4);
117        _sstack = .;
118        . = . + _system_stack_size;
119        . = ALIGN(4);
120        _estack = .;
121    } >RAM
122
123    __bss_start = .;
124    .bss :
125    {
126        . = ALIGN(4);
127        /* This is used by the startup in order to initialize the .bss secion */
128        _sbss = .;
129
130        *(.bss)
131        *(.bss.*)
132        *(COMMON)
133
134        . = ALIGN(4);
135        /* This is used by the startup in order to initialize the .bss secion */
136        _ebss = . ;
137
138        *(.bss.init)
139    } > RAM
140    __bss_end = .;
141
142    _end = .;
143
144    /* Stabs debugging sections.  */
145    .stab          0 : { *(.stab) }
146    .stabstr       0 : { *(.stabstr) }
147    .stab.excl     0 : { *(.stab.excl) }
148    .stab.exclstr  0 : { *(.stab.exclstr) }
149    .stab.index    0 : { *(.stab.index) }
150    .stab.indexstr 0 : { *(.stab.indexstr) }
151    .comment       0 : { *(.comment) }
152    /* DWARF debug sections.
153     * Symbols in the DWARF debugging sections are relative to the beginning
154     * of the section so we begin them at 0.  */
155    /* DWARF 1 */
156    .debug          0 : { *(.debug) }
157    .line           0 : { *(.line) }
158    /* GNU DWARF 1 extensions */
159    .debug_srcinfo  0 : { *(.debug_srcinfo) }
160    .debug_sfnames  0 : { *(.debug_sfnames) }
161    /* DWARF 1.1 and DWARF 2 */
162    .debug_aranges  0 : { *(.debug_aranges) }
163    .debug_pubnames 0 : { *(.debug_pubnames) }
164    /* DWARF 2 */
165    .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
166    .debug_abbrev   0 : { *(.debug_abbrev) }
167    .debug_line     0 : { *(.debug_line) }
168    .debug_frame    0 : { *(.debug_frame) }
169    .debug_str      0 : { *(.debug_str) }
170    .debug_loc      0 : { *(.debug_loc) }
171    .debug_macinfo  0 : { *(.debug_macinfo) }
172    /* SGI/MIPS DWARF 2 extensions */
173    .debug_weaknames 0 : { *(.debug_weaknames) }
174    .debug_funcnames 0 : { *(.debug_funcnames) }
175    .debug_typenames 0 : { *(.debug_typenames) }
176    .debug_varnames  0 : { *(.debug_varnames) }
177}
178