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    _heap_start = ABSOLUTE(.);
138  } >dram0_0_seg
139
140  .flash.rodata :
141  {
142    _rodata_start = ABSOLUTE(.);
143
144    mapping[flash_rodata]
145
146    *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */
147    *(.gnu.linkonce.r.*)
148    *(.rodata1)
149    __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
150    *(.xt_except_table)
151    *(.gcc_except_table .gcc_except_table.*)
152    *(.gnu.linkonce.e.*)
153    *(.gnu.version_r)
154    . = (. + 3) & ~ 3;
155    __eh_frame = ABSOLUTE(.);
156    KEEP(*(.eh_frame))
157    . = (. + 7) & ~ 3;
158    /*  C++ constructor and destructor tables, properly ordered:  */
159    __init_array_start = ABSOLUTE(.);
160    KEEP (*crtbegin.o(.ctors))
161    KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
162    KEEP (*(SORT(.ctors.*)))
163    KEEP (*(.ctors))
164    __init_array_end = ABSOLUTE(.);
165    KEEP (*crtbegin.o(.dtors))
166    KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
167    KEEP (*(SORT(.dtors.*)))
168    KEEP (*(.dtors))
169    /*  C++ exception handlers table:  */
170    __XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
171    *(.xt_except_desc)
172    *(.gnu.linkonce.h.*)
173    __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
174    *(.xt_except_desc_end)
175    *(.dynamic)
176    *(.gnu.version_d)
177    _rodata_end = ABSOLUTE(.);
178    /* Literals are also RO data. */
179    _lit4_start = ABSOLUTE(.);
180    *(*.lit4)
181    *(.lit4.*)
182    *(.gnu.linkonce.lit4.*)
183    _lit4_end = ABSOLUTE(.);
184    . = ALIGN(4);
185    _thread_local_start = ABSOLUTE(.);
186    *(.tdata)
187    *(.tdata.*)
188    *(.tbss)
189    *(.tbss.*)
190    _thread_local_end = ABSOLUTE(.);
191    . = ALIGN(4);
192  } >drom0_0_seg
193
194  .flash.text :
195  {
196    _stext = .;
197    _text_start = ABSOLUTE(.);
198
199    mapping[flash_text]
200
201    *(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
202    *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
203    *(.fini.literal)
204    *(.fini)
205    *(.gnu.version)
206    _text_end = ABSOLUTE(.);
207    _etext = .;
208
209    /* Similar to _iram_start, this symbol goes here so it is
210       resolved by addr2line in preference to the first symbol in
211       the flash.text segment.
212    */
213    _flash_cache_start = ABSOLUTE(0);
214  } >iram0_2_seg
215}
216