]> granicus.if.org Git - esp-idf/blob - components/esp32/ld/esp32.common.ld
heap: Add new multi_heap heap implementation to replace FreeRTOS-based tagged heaps
[esp-idf] / components / esp32 / ld / esp32.common.ld
1 /*  Default entry point:  */
2 ENTRY(call_start_cpu0);
3
4 SECTIONS
5 {
6   /* RTC fast memory holds RTC wake stub code,
7      including from any source file named rtc_wake_stub*.c
8   */
9   .rtc.text :
10   {
11     . = ALIGN(4);
12     *(.rtc.literal .rtc.text)
13     *rtc_wake_stub*.o(.literal .text .literal.* .text.*)
14   } >rtc_iram_seg
15
16   /* RTC slow memory holds RTC wake stub
17      data/rodata, including from any source file
18      named rtc_wake_stub*.c
19   */
20   .rtc.data :
21   {
22     _rtc_data_start = ABSOLUTE(.);
23     *(.rtc.data)
24     *(.rtc.rodata)
25     *rtc_wake_stub*.o(.data .rodata .data.* .rodata.* .bss .bss.*)
26     _rtc_data_end = ABSOLUTE(.);
27   } > rtc_slow_seg
28
29   /* RTC bss, from any source file named rtc_wake_stub*.c */
30   .rtc.bss (NOLOAD) :
31   {
32     _rtc_bss_start = ABSOLUTE(.);
33     *rtc_wake_stub*.o(.bss .bss.*)
34     *rtc_wake_stub*.o(COMMON)
35     _rtc_bss_end = ABSOLUTE(.);
36   } > rtc_slow_seg
37
38   /* Send .iram0 code to iram */
39   .iram0.vectors :
40   {
41     /* Vectors go to IRAM */
42     _init_start = ABSOLUTE(.);
43     /* Vectors according to builds/RF-2015.2-win32/esp108_v1_2_s5_512int_2/config.html */
44     . = 0x0;
45     KEEP(*(.WindowVectors.text));
46     . = 0x180;
47     KEEP(*(.Level2InterruptVector.text));
48     . = 0x1c0;
49     KEEP(*(.Level3InterruptVector.text));
50     . = 0x200;
51     KEEP(*(.Level4InterruptVector.text));
52     . = 0x240;
53     KEEP(*(.Level5InterruptVector.text));
54     . = 0x280;
55     KEEP(*(.DebugExceptionVector.text));
56     . = 0x2c0;
57     KEEP(*(.NMIExceptionVector.text));
58     . = 0x300;
59     KEEP(*(.KernelExceptionVector.text));
60     . = 0x340;
61     KEEP(*(.UserExceptionVector.text));
62     . = 0x3C0;
63     KEEP(*(.DoubleExceptionVector.text));
64     . = 0x400;
65     *(.*Vector.literal)
66
67     *(.UserEnter.literal);
68     *(.UserEnter.text);
69     . = ALIGN (16);
70     *(.entry.text)
71     *(.init.literal)
72     *(.init)
73     _init_end = ABSOLUTE(.);
74
75     /* This goes here, not at top of linker script, so addr2line finds it last,
76        and uses it in preference to the first symbol in IRAM */
77     _iram_start = ABSOLUTE(0);
78   } > iram0_0_seg
79
80   .iram0.text :
81   {
82     /* Code marked as runnning out of IRAM */
83     _iram_text_start = ABSOLUTE(.);
84     *(.iram1 .iram1.*)
85     *libfreertos.a:(.literal .text .literal.* .text.*)
86     *libheap.a:(.literal .text .literal.* .text.*)
87     *libesp32.a:panic.o(.literal .text .literal.* .text.*)
88     *libesp32.a:core_dump.o(.literal .text .literal.* .text.*)
89     *libesp32.a:heap_alloc_caps.o(.literal .text .literal.* .text.*)
90     *libapp_trace.a:(.literal .text .literal.* .text.*)
91     *libxtensa-debug-module.a:eri.o(.literal .text .literal.* .text.*)
92     *libphy.a:(.literal .text .literal.* .text.*)
93     *librtc.a:(.literal .text .literal.* .text.*)
94     *libsoc.a:(.literal .text .literal.* .text.*)
95     *libhal.a:(.literal .text .literal.* .text.*)
96     *libspi_flash.a:spi_flash_rom_patch.o(.literal .text .literal.* .text.*)
97     _iram_text_end = ABSOLUTE(.);
98   } > iram0_0_seg
99
100   .dram0.data :
101   {
102     _data_start = ABSOLUTE(.);
103     KEEP(*(.data))
104     KEEP(*(.data.*))
105     KEEP(*(.gnu.linkonce.d.*))
106     KEEP(*(.data1))
107     KEEP(*(.sdata))
108     KEEP(*(.sdata.*))
109     KEEP(*(.gnu.linkonce.s.*))
110     KEEP(*(.sdata2))
111     KEEP(*(.sdata2.*))
112     KEEP(*(.gnu.linkonce.s2.*))
113     KEEP(*(.jcr))
114     *(.dram1 .dram1.*)
115     *libesp32.a:panic.o(.rodata .rodata.*)
116     *libphy.a:(.rodata .rodata.*)
117     *libapp_trace.a:(.rodata .rodata.*)
118     _data_end = ABSOLUTE(.);
119     . = ALIGN(4);
120   } >dram0_0_seg
121
122   /* Shared RAM */
123   .dram0.bss (NOLOAD) :
124   {
125     . = ALIGN (8);
126     _bss_start = ABSOLUTE(.);
127     *(.dynsbss)
128     *(.sbss)
129     *(.sbss.*)
130     *(.gnu.linkonce.sb.*)
131     *(.scommon)
132     *(.sbss2)
133     *(.sbss2.*)
134     *(.gnu.linkonce.sb2.*)
135     *(.dynbss)
136     *(.bss)
137     *(.bss.*)
138     *(.share.mem)
139     *(.gnu.linkonce.b.*)
140     *(COMMON)
141     . = ALIGN (8);
142     _bss_end = ABSOLUTE(.);
143     _heap_start = ABSOLUTE(.);
144   } >dram0_0_seg
145
146   .flash.rodata :
147   {
148     _rodata_start = ABSOLUTE(.);
149     *(.rodata)
150     *(.rodata.*)
151     *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */
152     *(.gnu.linkonce.r.*)
153     *(.rodata1)
154     __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
155     *(.xt_except_table)
156     *(.gcc_except_table)
157     *(.gnu.linkonce.e.*)
158     *(.gnu.version_r)
159     *(.eh_frame)
160     . = (. + 3) & ~ 3;
161     /*  C++ constructor and destructor tables, properly ordered:  */
162     __init_array_start = ABSOLUTE(.);
163     KEEP (*crtbegin.o(.ctors))
164     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
165     KEEP (*(SORT(.ctors.*)))
166     KEEP (*(.ctors))
167     __init_array_end = ABSOLUTE(.);
168     KEEP (*crtbegin.o(.dtors))
169     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
170     KEEP (*(SORT(.dtors.*)))
171     KEEP (*(.dtors))
172     /*  C++ exception handlers table:  */
173     __XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
174     *(.xt_except_desc)
175     *(.gnu.linkonce.h.*)
176     __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
177     *(.xt_except_desc_end)
178     *(.dynamic)
179     *(.gnu.version_d)
180     _rodata_end = ABSOLUTE(.);
181     /* Literals are also RO data. */
182     _lit4_start = ABSOLUTE(.);
183     *(*.lit4)
184     *(.lit4.*)
185     *(.gnu.linkonce.lit4.*)
186     _lit4_end = ABSOLUTE(.);
187     . = ALIGN(4);
188   } >drom0_0_seg
189
190   .flash.text :
191   {
192     _stext = .;
193     _text_start = ABSOLUTE(.);
194     *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
195     *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
196     *(.fini.literal)
197     *(.fini)
198     *(.gnu.version)
199     _text_end = ABSOLUTE(.);
200     _etext = .;
201
202     /* Similar to _iram_start, this symbol goes here so it is
203        resolved by addr2line in preference to the first symbol in
204        the flash.text segment.
205     */
206     _flash_cache_start = ABSOLUTE(0);
207   } >iram0_2_seg
208 }