blob: 34c639f612b996cfd0124780c4e2358ddb65a14e [file] [log] [blame]
swissChili56cf8172022-07-30 18:47:48 -07001MEMORY
2{
3 irom (x): org = 0x42000000, len = 0x400000
4 drom (r): org = 0x3C000000, len = 0x400000
5 ram (rw): org = 0x3FC80000, len = 0x50000
6 rtc_ram (rx): org = 0x50000000, len = 0x2000
7}
8
9ENTRY(_start)
10
11SECTIONS
12{
13 .header : AT(0)
14 {
15 _irom_start = .;
16 LONG(0xaedb041d)
17 LONG(0xaedb041d)
18 } > irom
19
20 .text.entry ORIGIN(irom) + 8 :
21 {
22 KEEP(*(.text.entry))
23 } > irom
24
25 .text :
26 {
27 *(.text .stub .text.* .gnu.linkonce.t.*)
28 *(.gnu.warning)
29 }
30 . = ALIGN(4);
31 PROVIDE (__etext = .);
32 PROVIDE (_etext = .);
33 PROVIDE (etext = .);
34 _irom_size = . - _irom_start;
35
36 _drom_start = ORIGIN(drom) + _irom_size;
37 .rodata _drom_start : AT(_irom_size)
38 {
39 *(.rodata .rodata.* .gnu.linkonce.r.*)
40 } > drom
41
42 .rodata1 :
43 {
44 *(.rodata1)
45 }
46
47 .init_array :
48 {
49 PROVIDE_HIDDEN (__init_array_start = .);
50 KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*) SORT_BY_INIT_PRIORITY(.ctors.*)))
51 KEEP (*(.init_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .ctors))
52 PROVIDE_HIDDEN (__init_array_end = .);
53 } > drom
54
55 .fini_array :
56 {
57 PROVIDE_HIDDEN (__fini_array_start = .);
58 KEEP (*(SORT_BY_INIT_PRIORITY(.fini_array.*) SORT_BY_INIT_PRIORITY(.dtors.*)))
59 KEEP (*(.fini_array EXCLUDE_FILE (*crtbegin.o *crtbegin?.o *crtend.o *crtend?.o ) .dtors))
60 PROVIDE_HIDDEN (__fini_array_end = .);
61 } > drom
62
63 .ctors :
64 {
65 KEEP (*crtbegin.o(.ctors))
66 KEEP (*crtbegin?.o(.ctors))
67 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors))
68 KEEP (*(SORT(.ctors.*)))
69 KEEP (*(.ctors))
70 }
71
72 .dtors :
73 {
74 KEEP (*crtbegin.o(.dtors))
75 KEEP (*crtbegin?.o(.dtors))
76 KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors))
77 KEEP (*(SORT(.dtors.*)))
78 KEEP (*(.dtors))
79 }
80
81 _drom_size = . - _drom_start;
82
83 .data ORIGIN(ram) : AT(_irom_size + _drom_size)
84 {
85 _data_start = .;
86 __DATA_BEGIN__ = .;
87 *(.data .data.* .gnu.linkonce.d.*)
88 *(.data.rel.ro.local* .gnu.linkonce.d.rel.ro.local.*) *(.data.rel.ro .data.rel.ro.* .gnu.linkonce.d.rel.ro.*)
89 SORT(CONSTRUCTORS)
90 } > ram
91 .data1 :
92 {
93 *(.data1)
94 }
95 .sdata :
96 {
97 __SDATA_BEGIN__ = .;
98 *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata .srodata.*)
99 *(.sdata .sdata.* .gnu.linkonce.s.*)
100 }
101 . = ALIGN(4);
102 _edata = .; PROVIDE (edata = .);
103 _data_lma = ORIGIN(drom) + LOADADDR(.data);
104 _data_size = _edata - _data_start;
105
106 __bss_start = .;
107 .sbss :
108 {
109 *(.dynsbss)
110 *(.sbss .sbss.* .gnu.linkonce.sb.*)
111 *(.scommon)
112 }
113 .bss :
114 {
115 *(.dynbss)
116 *(.bss .bss.* .gnu.linkonce.b.*)
117 *(COMMON)
118 }
119 . = ALIGN(4);
120 __BSS_END__ = .;
121 __global_pointer$ = MIN(__SDATA_BEGIN__ + 0x800,
122 MAX(__DATA_BEGIN__ + 0x800, __BSS_END__ - 0x800));
123 _end = .; PROVIDE (end = .);
124
125 /* Stack */
126 .stack :
127 {
128 __stack_bottom = .;
129 __stack_top = ORIGIN(ram) + LENGTH(ram);
130 __stack_size_min = 0x4000;
131 ASSERT(__stack_bottom + __stack_size_min < __stack_top, "Error: no space for stack");
132 }
133
134 /* Stabs debugging sections. */
135 .stab 0 : { *(.stab) }
136 .stabstr 0 : { *(.stabstr) }
137 .stab.excl 0 : { *(.stab.excl) }
138 .stab.exclstr 0 : { *(.stab.exclstr) }
139 .stab.index 0 : { *(.stab.index) }
140 .stab.indexstr 0 : { *(.stab.indexstr) }
141 .comment 0 : { *(.comment) }
142 .gnu.build.attributes : { *(.gnu.build.attributes .gnu.build.attributes.*) }
143 /* DWARF debug sections.
144 Symbols in the DWARF debugging sections are relative to the beginning
145 of the section so we begin them at 0. */
146 /* DWARF 1 */
147 .debug 0 : { *(.debug) }
148 .line 0 : { *(.line) }
149 /* GNU DWARF 1 extensions */
150 .debug_srcinfo 0 : { *(.debug_srcinfo) }
151 .debug_sfnames 0 : { *(.debug_sfnames) }
152 /* DWARF 1.1 and DWARF 2 */
153 .debug_aranges 0 : { *(.debug_aranges) }
154 .debug_pubnames 0 : { *(.debug_pubnames) }
155 /* DWARF 2 */
156 .debug_info 0 : { *(.debug_info .gnu.linkonce.wi.*) }
157 .debug_abbrev 0 : { *(.debug_abbrev) }
158 .debug_line 0 : { *(.debug_line .debug_line.* .debug_line_end) }
159 .debug_frame 0 : { *(.debug_frame) }
160 .debug_str 0 : { *(.debug_str) }
161 .debug_loc 0 : { *(.debug_loc) }
162 .debug_macinfo 0 : { *(.debug_macinfo) }
163 /* SGI/MIPS DWARF 2 extensions */
164 .debug_weaknames 0 : { *(.debug_weaknames) }
165 .debug_funcnames 0 : { *(.debug_funcnames) }
166 .debug_typenames 0 : { *(.debug_typenames) }
167 .debug_varnames 0 : { *(.debug_varnames) }
168 /* DWARF 3 */
169 .debug_pubtypes 0 : { *(.debug_pubtypes) }
170 .debug_ranges 0 : { *(.debug_ranges) }
171 /* DWARF Extension. */
172 .debug_macro 0 : { *(.debug_macro) }
173 .debug_addr 0 : { *(.debug_addr) }
174 .gnu.attributes 0 : { KEEP (*(.gnu.attributes)) }
175 /DISCARD/ : { *(.note.GNU-stack) *(.gnu_debuglink) *(.gnu.lto_*) }
176}
177
178/* ESP32C3 ROM functions from ./interface-esp32c3.yml */
179
180/* Functions */
181__absvdi2 = 0x40000764;
182__absvsi2 = 0x40000768;
183__adddf3 = 0x4000076c;
184__addsf3 = 0x40000770;
185__addvdi3 = 0x40000774;
186__addvsi3 = 0x40000778;
187__ashldi3 = 0x4000077c;
188__ashrdi3 = 0x40000780;
189__bswapdi2 = 0x40000784;
190__bswapsi2 = 0x40000788;
191__clear_cache = 0x4000078c;
192__clrsbdi2 = 0x40000790;
193__clrsbsi2 = 0x40000794;
194__clzdi2 = 0x40000798;
195__clzsi2 = 0x4000079c;
196__cmpdi2 = 0x400007a0;
197__ctzdi2 = 0x400007a4;
198__ctzsi2 = 0x400007a8;
199__divdc3 = 0x400007ac;
200__divdf3 = 0x400007b0;
201__divdi3 = 0x400007b4;
202__divsc3 = 0x400007b8;
203__divsf3 = 0x400007bc;
204__divsi3 = 0x400007c0;
205__eqdf2 = 0x400007c4;
206__eqsf2 = 0x400007c8;
207__extendsfdf2 = 0x400007cc;
208__ffsdi2 = 0x400007d0;
209__ffssi2 = 0x400007d4;
210__fixdfdi = 0x400007d8;
211__fixdfsi = 0x400007dc;
212__fixsfdi = 0x400007e0;
213__fixsfsi = 0x400007e4;
214__fixunsdfsi = 0x400007e8;
215__fixunssfdi = 0x400007ec;
216__fixunssfsi = 0x400007f0;
217__floatdidf = 0x400007f4;
218__floatdisf = 0x400007f8;
219__floatsidf = 0x400007fc;
220__floatsisf = 0x40000800;
221__floatundidf = 0x40000804;
222__floatundisf = 0x40000808;
223__floatunsidf = 0x4000080c;
224__floatunsisf = 0x40000810;
225__gcc_bcmp = 0x40000814;
226__gedf2 = 0x40000818;
227__gesf2 = 0x4000081c;
228__gtdf2 = 0x40000820;
229__gtsf2 = 0x40000824;
230__ledf2 = 0x40000828;
231__lesf2 = 0x4000082c;
232__lshrdi3 = 0x40000830;
233__ltdf2 = 0x40000834;
234__ltsf2 = 0x40000838;
235__moddi3 = 0x4000083c;
236__modsi3 = 0x40000840;
237__muldc3 = 0x40000844;
238__muldf3 = 0x40000848;
239__muldi3 = 0x4000084c;
240__mulsc3 = 0x40000850;
241__mulsf3 = 0x40000854;
242__mulsi3 = 0x40000858;
243__mulvdi3 = 0x4000085c;
244__mulvsi3 = 0x40000860;
245__nedf2 = 0x40000864;
246__negdf2 = 0x40000868;
247__negdi2 = 0x4000086c;
248__negsf2 = 0x40000870;
249__negvdi2 = 0x40000874;
250__negvsi2 = 0x40000878;
251__nesf2 = 0x4000087c;
252__paritysi2 = 0x40000880;
253__popcountdi2 = 0x40000884;
254__popcountsi2 = 0x40000888;
255__powidf2 = 0x4000088c;
256__powisf2 = 0x40000890;
257__subdf3 = 0x40000894;
258__subsf3 = 0x40000898;
259__subvdi3 = 0x4000089c;
260__subvsi3 = 0x400008a0;
261__truncdfsf2 = 0x400008a4;
262__ucmpdi2 = 0x400008a8;
263__udivdi3 = 0x400008ac;
264__udivmoddi4 = 0x400008b0;
265__udivsi3 = 0x400008b4;
266__udiv_w_sdiv = 0x400008b8;
267__umoddi3 = 0x400008bc;
268__umodsi3 = 0x400008c0;
269__unorddf2 = 0x400008c4;
270__unordsf2 = 0x400008c8;
271
272
273/***************************************
274Group newlib
275***************************************/
276
277/* Functions */
278memset = 0x40000354;
279memcpy = 0x40000358;
280memmove = 0x4000035c;
281memcmp = 0x40000360;
282strcpy = 0x40000364;
283strncpy = 0x40000368;
284strcmp = 0x4000036c;
285strncmp = 0x40000370;
286strlen = 0x40000374;
287strstr = 0x40000378;
288bzero = 0x4000037c;
289isalnum = 0x40000388;
290isalpha = 0x4000038c;
291isascii = 0x40000390;
292isblank = 0x40000394;
293iscntrl = 0x40000398;
294isdigit = 0x4000039c;
295islower = 0x400003a0;
296isgraph = 0x400003a4;
297isprint = 0x400003a8;
298ispunct = 0x400003ac;
299isspace = 0x400003b0;
300isupper = 0x400003b4;
301toupper = 0x400003b8;
302tolower = 0x400003bc;
303toascii = 0x400003c0;
304memccpy = 0x400003c4;
305memchr = 0x400003c8;
306memrchr = 0x400003cc;
307strcasecmp = 0x400003d0;
308strcasestr = 0x400003d4;
309strcat = 0x400003d8;
310strdup = 0x400003dc;
311strchr = 0x400003e0;
312strcspn = 0x400003e4;
313strcoll = 0x400003e8;
314strlcat = 0x400003ec;
315strlcpy = 0x400003f0;
316strlwr = 0x400003f4;
317strncasecmp = 0x400003f8;
318strncat = 0x400003fc;
319strndup = 0x40000400;
320strnlen = 0x40000404;
321strrchr = 0x40000408;
322strsep = 0x4000040c;
323strspn = 0x40000410;
324strtok_r = 0x40000414;
325strupr = 0x40000418;
326longjmp = 0x4000041c;
327setjmp = 0x40000420;
328abs = 0x40000424;
329div = 0x40000428;
330labs = 0x4000042c;
331ldiv = 0x40000430;
332qsort = 0x40000434;
333rand_r = 0x40000438;
334rand = 0x4000043c;
335srand = 0x40000440;
336utoa = 0x40000444;
337itoa = 0x40000448;
338atoi = 0x4000044c;
339atol = 0x40000450;
340strtol = 0x40000454;
341strtoul = 0x40000458;
342
343uart_tx_one_char = 0x40000068;
344uart_rx_one_char = 0x40000070;
345uart_rx_one_char_block = 0x40000074;
346uart_tx_flush = 0x40000080;
347
348/***************************************
349Group gpio
350***************************************/
351
352/* Functions */
353gpio_input_get = 0x4000059c;
354gpio_matrix_in = 0x400005a0;
355gpio_matrix_out = 0x400005a4;
356gpio_output_disable = 0x400005a8;
357gpio_output_enable = 0x400005ac;
358gpio_output_set = 0x400005b0;
359gpio_pad_hold = 0x400005b4;
360gpio_pad_input_disable = 0x400005b8;
361gpio_pad_input_enable = 0x400005bc;
362gpio_pad_pulldown = 0x400005c0;
363gpio_pad_pullup = 0x400005c4;
364gpio_pad_select_gpio = 0x400005c8;
365gpio_pad_set_drv = 0x400005cc;
366gpio_pad_unhold = 0x400005d0;
367gpio_pin_wakeup_disable = 0x400005d4;
368gpio_pin_wakeup_enable = 0x400005d8;
369gpio_bypass_matrix_in = 0x400005dc;