swissChili | 56cf817 | 2022-07-30 18:47:48 -0700 | [diff] [blame] | 1 | MEMORY |
| 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 | |
| 9 | ENTRY(_start) |
| 10 | |
| 11 | SECTIONS |
| 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 | /*************************************** |
| 274 | Group newlib |
| 275 | ***************************************/ |
| 276 | |
| 277 | /* Functions */ |
| 278 | memset = 0x40000354; |
| 279 | memcpy = 0x40000358; |
| 280 | memmove = 0x4000035c; |
| 281 | memcmp = 0x40000360; |
| 282 | strcpy = 0x40000364; |
| 283 | strncpy = 0x40000368; |
| 284 | strcmp = 0x4000036c; |
| 285 | strncmp = 0x40000370; |
| 286 | strlen = 0x40000374; |
| 287 | strstr = 0x40000378; |
| 288 | bzero = 0x4000037c; |
| 289 | isalnum = 0x40000388; |
| 290 | isalpha = 0x4000038c; |
| 291 | isascii = 0x40000390; |
| 292 | isblank = 0x40000394; |
| 293 | iscntrl = 0x40000398; |
| 294 | isdigit = 0x4000039c; |
| 295 | islower = 0x400003a0; |
| 296 | isgraph = 0x400003a4; |
| 297 | isprint = 0x400003a8; |
| 298 | ispunct = 0x400003ac; |
| 299 | isspace = 0x400003b0; |
| 300 | isupper = 0x400003b4; |
| 301 | toupper = 0x400003b8; |
| 302 | tolower = 0x400003bc; |
| 303 | toascii = 0x400003c0; |
| 304 | memccpy = 0x400003c4; |
| 305 | memchr = 0x400003c8; |
| 306 | memrchr = 0x400003cc; |
| 307 | strcasecmp = 0x400003d0; |
| 308 | strcasestr = 0x400003d4; |
| 309 | strcat = 0x400003d8; |
| 310 | strdup = 0x400003dc; |
| 311 | strchr = 0x400003e0; |
| 312 | strcspn = 0x400003e4; |
| 313 | strcoll = 0x400003e8; |
| 314 | strlcat = 0x400003ec; |
| 315 | strlcpy = 0x400003f0; |
| 316 | strlwr = 0x400003f4; |
| 317 | strncasecmp = 0x400003f8; |
| 318 | strncat = 0x400003fc; |
| 319 | strndup = 0x40000400; |
| 320 | strnlen = 0x40000404; |
| 321 | strrchr = 0x40000408; |
| 322 | strsep = 0x4000040c; |
| 323 | strspn = 0x40000410; |
| 324 | strtok_r = 0x40000414; |
| 325 | strupr = 0x40000418; |
| 326 | longjmp = 0x4000041c; |
| 327 | setjmp = 0x40000420; |
| 328 | abs = 0x40000424; |
| 329 | div = 0x40000428; |
| 330 | labs = 0x4000042c; |
| 331 | ldiv = 0x40000430; |
| 332 | qsort = 0x40000434; |
| 333 | rand_r = 0x40000438; |
| 334 | rand = 0x4000043c; |
| 335 | srand = 0x40000440; |
| 336 | utoa = 0x40000444; |
| 337 | itoa = 0x40000448; |
| 338 | atoi = 0x4000044c; |
| 339 | atol = 0x40000450; |
| 340 | strtol = 0x40000454; |
| 341 | strtoul = 0x40000458; |
| 342 | |
| 343 | uart_tx_one_char = 0x40000068; |
| 344 | uart_rx_one_char = 0x40000070; |
| 345 | uart_rx_one_char_block = 0x40000074; |
| 346 | uart_tx_flush = 0x40000080; |
| 347 | |
| 348 | /*************************************** |
| 349 | Group gpio |
| 350 | ***************************************/ |
| 351 | |
| 352 | /* Functions */ |
| 353 | gpio_input_get = 0x4000059c; |
| 354 | gpio_matrix_in = 0x400005a0; |
| 355 | gpio_matrix_out = 0x400005a4; |
| 356 | gpio_output_disable = 0x400005a8; |
| 357 | gpio_output_enable = 0x400005ac; |
| 358 | gpio_output_set = 0x400005b0; |
| 359 | gpio_pad_hold = 0x400005b4; |
| 360 | gpio_pad_input_disable = 0x400005b8; |
| 361 | gpio_pad_input_enable = 0x400005bc; |
| 362 | gpio_pad_pulldown = 0x400005c0; |
| 363 | gpio_pad_pullup = 0x400005c4; |
| 364 | gpio_pad_select_gpio = 0x400005c8; |
| 365 | gpio_pad_set_drv = 0x400005cc; |
| 366 | gpio_pad_unhold = 0x400005d0; |
| 367 | gpio_pin_wakeup_disable = 0x400005d4; |
| 368 | gpio_pin_wakeup_enable = 0x400005d8; |
| 369 | gpio_bypass_matrix_in = 0x400005dc; |