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