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