1/*
2 * Copyright (c) 2024 Espressif Systems (Shanghai) Co., Ltd.
3 * SPDX-License-Identifier: Apache-2.0
4 */
5
6#include <zephyr/devicetree.h>
7#include <zephyr/linker/sections.h>
8#include <zephyr/linker/linker-defs.h>
9#include <zephyr/linker/linker-tool.h>
10
11#include "memory.h"
12
13/* User available SRAM memory segments */
14procpu_iram_end = USER_IRAM_END - APPCPU_SRAM_SIZE;
15procpu_dram_end = USER_DRAM_END - APPCPU_SRAM_SIZE;
16
17procpu_iram_org = SRAM_USER_IRAM_START;
18procpu_iram_len = procpu_iram_end - procpu_iram_org;
19
20procpu_dram_org = SRAM1_DRAM_START;
21procpu_dram_len = procpu_dram_end - procpu_dram_org;
22
23/* Aliases */
24#define FLASH_CODE_REGION  irom0_0_seg
25#define RODATA_REGION      drom0_0_seg
26#define IRAM_REGION        iram0_0_seg
27#define RAMABLE_REGION     dram0_0_seg
28#define ROMABLE_REGION     FLASH
29
30/* Zephyr macro re-definitions */
31#undef GROUP_DATA_LINK_IN
32#define GROUP_DATA_LINK_IN(vregion, lregion) > vregion AT > lregion
33
34#undef GROUP_NOLOAD_LINK_IN
35#define GROUP_NOLOAD_LINK_IN(vregion, lregion) > vregion
36
37/* Flash segments (rodata and text) should be mapped in the virtual address spaces.
38 * Executing directly from LMA is not possible. */
39#undef GROUP_ROM_LINK_IN
40#define GROUP_ROM_LINK_IN(vregion, lregion) > RODATA_REGION AT > lregion
41
42/* Make sure new sections have consistent alignment between input and output sections */
43#undef SECTION_DATA_PROLOGUE
44#define SECTION_DATA_PROLOGUE(name, options, align) name options : ALIGN_WITH_INPUT
45
46#undef SECTION_PROLOGUE
47#define SECTION_PROLOGUE SECTION_DATA_PROLOGUE
48
49MEMORY
50{
51#ifdef CONFIG_BOOTLOADER_MCUBOOT
52  mcuboot_hdr (R):  org = 0x0,  len = 0x20
53  metadata (R):     org = 0x20, len = 0x20
54  FLASH (R):        org = 0x40, len = FLASH_SIZE - 0x40
55#else
56  /* Make safety margin in the FLASH memory size so the
57   * (esp_img_header + (n*esp_seg_headers)) would fit */
58  FLASH (R):        org = 0x0, len = FLASH_SIZE - 0x100
59#endif /* CONFIG_BOOTLOADER_MCUBOOT */
60
61  iram0_0_seg(RX): org = procpu_iram_org, len = procpu_iram_len
62  dram0_0_seg(RW): org = procpu_dram_org, len = procpu_dram_len
63
64  irom0_0_seg(RX): org = IROM_SEG_ORG, len = IROM_SEG_LEN
65  drom0_0_seg(R):  org = DROM_SEG_ORG, len = DROM_SEG_LEN
66
67  /* The `ext_ram_seg` and `drom0_0_seg` share the same bus and the address region.
68   * A dummy section is used to avoid overlap. See `.ext_ram.dummy` in `sections.ld.in`
69   */
70#if defined(CONFIG_ESP_SPIRAM)
71  /* `ext_[id]ram_seg` and `drom0_0_seg` share the same bus and the address region.
72   * A dummy section is used to avoid overlap. See `.ext_ram.dummy` */
73  ext_dram_seg(RW): org = DROM_SEG_ORG, len = (CONFIG_ESP_SPIRAM_SIZE)
74  ext_iram_seg(RX): org = IROM_SEG_ORG, len = (CONFIG_ESP_SPIRAM_SIZE)
75#endif
76
77  /* RTC fast memory (executable). Persists over deep sleep.
78   */
79  rtc_iram_seg(RWX): org = 0x600fe000, len = 0x2000
80
81  /* RTC fast memory (same block as above), viewed from data bus
82   */
83  rtc_data_seg(RW): org = 0x600fe000, len = 0x2000
84
85  /* RTC slow memory (data accessible). Persists over deep sleep.
86   */
87  rtc_slow_seg(RW): org = 0x50000000, len = 0x2000
88
89#ifdef CONFIG_GEN_ISR_TABLES
90  IDT_LIST(RW): org = 0x3ebfe010, len = 0x2000
91#endif
92}
93
94/*  Default entry point:  */
95ENTRY(CONFIG_KERNEL_ENTRY)
96
97/* Used as a pointer to the heap end */
98#ifdef CONFIG_SOC_ENABLE_APPCPU
99_heap_sentry = procpu_dram_end;
100#else
101_heap_sentry = DRAM_RESERVED_START;
102#endif
103
104SECTIONS
105{
106  _iram_dram_offset = IRAM_DRAM_OFFSET;
107
108#ifdef CONFIG_BOOTLOADER_MCUBOOT
109  /* Reserve space for MCUboot header in the binary */
110  .mcuboot_header :
111  {
112    QUAD(0x0)
113    QUAD(0x0)
114    QUAD(0x0)
115    QUAD(0x0)
116  } > mcuboot_hdr
117  /* Image load table */
118  .metadata :
119  {
120    /* 0. Magic byte for load header */
121    LONG(0xace637d3)
122
123    /* 1. Application entry point address */
124    KEEP(*(.entry_addr))
125
126    /* IRAM metadata:
127     * 2. Destination address (VMA) for IRAM region
128     * 3. Flash offset (LMA) for start of IRAM region
129     * 4. Size of IRAM region
130     */
131    LONG(ADDR(.iram0.vectors))
132    LONG(LOADADDR(.iram0.vectors))
133    LONG(LOADADDR(.iram0.text) + SIZEOF(.iram0.text) - LOADADDR(.iram0.vectors))
134
135    /* DRAM metadata:
136     * 5. Destination address (VMA) for DRAM region
137     * 6. Flash offset (LMA) for start of DRAM region
138     * 7. Size of DRAM region
139     */
140    LONG(ADDR(.dram0.data))
141    LONG(LOADADDR(.dram0.data))
142    LONG(LOADADDR(.dram0.end) + SIZEOF(.dram0.end) - LOADADDR(.dram0.data))
143  } > metadata
144#endif /* CONFIG_BOOTLOADER_MCUBOOT */
145
146/* Virtual non-loadable sections */
147#include <zephyr/linker/rel-sections.ld>
148
149#ifdef CONFIG_LLEXT
150#include <zephyr/linker/llext-sections.ld>
151#endif
152
153  /* --- START OF RTC --- */
154
155  /* RTC fast memory holds RTC wake stub code */
156  .rtc.text :
157  {
158    . = ALIGN(4);
159    _rtc_fast_start = ABSOLUTE(.);
160    _rtc_text_start = ABSOLUTE(.);
161    *(.rtc.entry.literal .rtc.text)
162    *(.rtc.entry.text)
163    _rtc_text_end = ABSOLUTE(.);
164  } GROUP_DATA_LINK_IN(rtc_iram_seg, ROMABLE_REGION)
165
166  /* This section located in RTC FAST Memory area.
167   * It holds data marked with RTC_FAST_ATTR attribute.
168   * See the file "esp_attr.h" for more information.
169   */
170  .rtc.force_fast :
171  {
172    . = ALIGN(4);
173    _rtc_force_fast_start = ABSOLUTE(.);
174
175    *(.rtc.force_fast .rtc.force_fast.*)
176    . = ALIGN(4) ;
177    _rtc_force_fast_end = ABSOLUTE(.);
178  } GROUP_DATA_LINK_IN(rtc_data_seg, ROMABLE_REGION)
179
180  /* RTC data section holds data marked with
181   * RTC_DATA_ATTR, RTC_RODATA_ATTR attributes.
182   */
183  .rtc.data :
184  {
185    _rtc_data_start = ABSOLUTE(.);
186    *(.rtc.data)
187    *(.rtc.rodata)
188    _rtc_data_end = ABSOLUTE(.);
189  } GROUP_DATA_LINK_IN(rtc_slow_seg, ROMABLE_REGION)
190
191  .rtc.bss (NOLOAD) :
192  {
193    _rtc_bss_start = ABSOLUTE(.);
194
195    *(.rtc.data)
196    *(.rtc.rodata)
197
198    _rtc_bss_end = ABSOLUTE(.);
199  } GROUP_LINK_IN(rtc_slow_seg)
200
201  /* This section holds data that should not be initialized at power up
202   * and will be retained during deep sleep.
203   * User data marked with RTC_NOINIT_ATTR will be placed
204   * into this section. See the file "esp_attr.h" for more information.
205   */
206  .rtc_noinit (NOLOAD):
207  {
208    . = ALIGN(4);
209    _rtc_noinit_start = ABSOLUTE(.);
210    *(.rtc_noinit .rtc_noinit.*)
211    . = ALIGN(4) ;
212    _rtc_noinit_end = ABSOLUTE(.);
213  } GROUP_LINK_IN(rtc_slow_seg)
214
215  /* This section located in RTC SLOW Memory area.
216   * It holds data marked with RTC_SLOW_ATTR attribute.
217   * See the file "esp_attr.h" for more information.
218   */
219  .rtc.force_slow :
220  {
221    . = ALIGN(4);
222    _rtc_force_slow_start = ABSOLUTE(.);
223    *(.rtc.force_slow .rtc.force_slow.*)
224    . = ALIGN(4);
225    _rtc_force_slow_end = ABSOLUTE(.);
226  } GROUP_DATA_LINK_IN(rtc_slow_seg, ROMABLE_REGION)
227
228  /* Get size of rtc slow data based on rtc_data_location alias */
229  _rtc_slow_length = (_rtc_force_slow_end - _rtc_data_start);
230  _rtc_fast_length = (_rtc_force_fast_end - _rtc_fast_start);
231
232  ASSERT((_rtc_slow_length <= LENGTH(rtc_slow_seg)), "RTC_SLOW segment data does not fit.")
233  ASSERT((_rtc_fast_length <= LENGTH(rtc_data_seg)), "RTC_FAST segment data does not fit.")
234
235  /* --- END OF RTC --- */
236
237  /* --- START OF IRAM --- */
238
239  /* Send .iram0 code to iram */
240  .iram0.vectors : ALIGN(4)
241  {
242    /* Vectors go to IRAM */
243    _init_start = ABSOLUTE(.);
244    /* Vectors according to builds/RF-2015.2-win32/esp108_v1_2_s5_512int_2/config.html */
245    . = 0x0;
246    KEEP(*(.WindowVectors.text));
247    . = 0x180;
248    KEEP(*(.Level2InterruptVector.text));
249    . = 0x1c0;
250    KEEP(*(.Level3InterruptVector.text));
251    . = 0x200;
252    KEEP(*(.Level4InterruptVector.text));
253    . = 0x240;
254    KEEP(*(.Level5InterruptVector.text));
255    . = 0x280;
256    KEEP(*(.DebugExceptionVector.text));
257    . = 0x2c0;
258    KEEP(*(.NMIExceptionVector.text));
259    . = 0x300;
260    KEEP(*(.KernelExceptionVector.text));
261    . = 0x340;
262    KEEP(*(.UserExceptionVector.text));
263    . = 0x3C0;
264    KEEP(*(.DoubleExceptionVector.text));
265    . = 0x400;
266    _invalid_pc_placeholder = ABSOLUTE(.);
267    *(.*Vector.literal)
268
269    *(.UserEnter.literal);
270    *(.UserEnter.text);
271    . = ALIGN (16);
272    *(.entry.text)
273    *(.init.literal)
274    *(.init)
275    _init_end = ABSOLUTE(.);
276
277    _iram_start = ABSOLUTE(.);
278  } GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
279
280  .iram0.text : ALIGN(4)
281  {
282    /* Code marked as running out of IRAM */
283    _iram_text_start = ABSOLUTE(.);
284    *(.iram1 .iram1.*)
285    *(.iram0.literal .iram.literal .iram.text.literal .iram0.text .iram.text)
286    *libarch__xtensa__core.a:(.literal .text .literal.* .text.*)
287    *libkernel.a:(.literal .text .literal.* .text.*)
288    *libgcc.a:lib2funcs.*(.literal .text .literal.* .text.*)
289    *libzephyr.a:cbprintf_packaged.*(.literal .text .literal.* .text.*)
290    *libdrivers__flash.a:flash_esp32.*(.literal .text .literal.* .text.*)
291    *libzephyr.a:windowspill_asm.*(.literal .text .literal.* .text.*)
292    *libzephyr.a:log_noos.*(.literal .text .literal.* .text.*)
293    *libdrivers__timer.a:xtensa_sys_timer.*(.literal .text .literal.* .text.*)
294    *libzephyr.a:log_core.*(.literal .text .literal.* .text.*)
295    *libzephyr.a:cbprintf_complete.*(.literal .text .literal.* .text.*)
296    *libzephyr.a:printk.*(.literal.printk .literal.vprintk .literal.char_out .text.printk .text.vprintk .text.char_out)
297    *libzephyr.a:log_msg.*(.literal .text .literal.* .text.*)
298    *libzephyr.a:log_list.*(.literal .text .literal.* .text.*)
299    *libdrivers__console.a:uart_console.*(.literal.console_out .text.console_out)
300    *libzephyr.a:log_output.*(.literal .text .literal.* .text.*)
301    *libzephyr.a:log_backend_uart.*(.literal .text .literal.* .text.*)
302    *libzephyr.a:log_minimal.*(.literal .literal.* .text .text.*)
303    *libzephyr.a:loader.*(.literal .text .literal.* .text.*)
304    *libzephyr.a:flash_init.*(.literal .text .literal.* .text.*)
305    *libzephyr.a:soc_flash_init.*(.literal .text .literal.* .text.*)
306    *libzephyr.a:console_init.*(.literal .text .literal.* .text.*)
307    *libzephyr.a:soc_init.*(.literal .text .literal.* .text.*)
308    *libzephyr.a:hw_init.*(.literal .text .literal.* .text.*)
309    *libzephyr.a:soc_random.*(.literal .text .literal.* .text.*)
310    *libzephyr.a:esp_mmu_map.*(.literal .literal.* .text .text.*)
311    *libdrivers__interrupt_controller.a:(.literal .literal.* .text .text.*)
312    *liblib__libc__minimal.a:string.*(.literal .text .literal.* .text.*)
313    *liblib__libc__newlib.a:string.*(.literal .text .literal.* .text.*)
314    *liblib__libc__picolibc.a:string.*(.literal .text .literal.* .text.*)
315    *libphy.a:(.phyiram .phyiram.*)
316    *libgcov.a:(.literal .text .literal.* .text.*)
317
318    /* APPCPU_ENABLED */
319    *libzephyr.a:esp32s3-mp.*(.literal .text .literal.* .text.*)
320    *libzephyr.a:bootloader_flash.*(.literal .text .literal.* .text.*)
321    *libzephyr.a:flash_mmap.*(.literal .text .literal.* .text.*)
322
323    /* [mapping:esp_psram] */
324    *libzephyr.a:mmu_psram_flash.*(.literal .literal.* .text .text.*)
325    *libzephyr.a:esp_psram_impl_quad.*(.literal .literal.* .text .text.*)
326    *libzephyr.a:esp_psram_impl_octal.*(.literal .literal.* .text .text.*)
327
328    /* [mapping:hal] */
329    *libzephyr.a:mmu_hal.*(.literal .text .literal.* .text.*)
330    *libzephyr.a:spi_flash_hal_iram.*(.literal .text .literal.* .text.*)
331    *libzephyr.a:spi_flash_encrypt_hal_iram.*(.literal .text .literal.* .text.*)
332    *libzephyr.a:cache_hal.*(.literal .text .literal.* .text.*)
333    *libzephyr.a:ledc_hal_iram.*(.literal .text .literal.* .text.*)
334    *libzephyr.a:i2c_hal_iram.*(.literal .text .literal.* .text.*)
335    *libzephyr.a:wdt_hal_iram.*(.literal .text .literal.* .text.*)
336    *libzephyr.a:systimer_hal.*(.literal .text .literal.* .text.*)
337    *libzephyr.a:spi_flash_hal_gpspi.*(.literal .text .literal.* .text.*)
338
339    /* [mapping:soc] */
340    *libzephyr.a:lldesc.*(.literal .literal.* .text .text.*)
341
342    /* [mapping:log] */
343    *(.literal.esp_log_write .text.esp_log_write)
344    *(.literal.esp_log_timestamp .text.esp_log_timestamp)
345    *(.literal.esp_log_early_timestamp .text.esp_log_early_timestamp)
346    *(.literal.esp_log_impl_lock .text.esp_log_impl_lock)
347    *(.literal.esp_log_impl_lock_timeout .text.esp_log_impl_lock_timeout)
348    *(.literal.esp_log_impl_unlock .text.esp_log_impl_unlock)
349
350    /* [mapping:spi_flash] */
351    *libzephyr.a:spi_flash_chip_boya.*(.literal .literal.* .text .text.*)
352    *libzephyr.a:spi_flash_chip_gd.*(.literal .literal.* .text .text.*)
353    *libzephyr.a:spi_flash_chip_generic.*(.literal .literal.* .text .text.*)
354    *libzephyr.a:spi_flash_chip_issi.*(.literal .literal.* .text .text.*)
355    *libzephyr.a:spi_flash_chip_mxic.*(.literal .literal.* .text .text.*)
356    *libzephyr.a:spi_flash_chip_mxic_opi.*(.literal .literal.* .text .text.*)
357    *libzephyr.a:spi_flash_chip_th.*(.literal .literal.* .text .text.*)
358    *libzephyr.a:spi_flash_chip_winbond.*(.literal .literal.* .text .text.*)
359    *libzephyr.a:memspi_host_driver.*(.literal .literal.* .text .text.*)
360    *libzephyr.a:flash_brownout_hook.*(.literal .literal.* .text .text.*)
361    *libzephyr.a:spi_flash_wrap.*(.literal .literal.* .text .text.*)
362    *libzephyr.a:spi_flash_hpm_enable.*(.literal .literal.* .text .text.*)
363    *libzephyr.a:spi_flash_oct_flash_init.*(.literal .literal.* .text .text.*)
364    *libzephyr.a:flash_ops.*(.literal .literal.* .text .text.*)
365
366    /* [mapping:esp_system] */
367    *libzephyr.a:esp_err.*(.literal .literal.* .text .text.*)
368    *(.literal.esp_system_abort .text.esp_system_abort)
369
370    /* [mapping:esp_hw_support] */
371    *(.literal.esp_cpu_stall .text.esp_cpu_stall)
372    *(.literal.esp_cpu_unstall .text.esp_cpu_unstall)
373    *(.literal.esp_cpu_reset .text.esp_cpu_reset)
374    *(.literal.esp_cpu_wait_for_intr .text.esp_cpu_wait_for_intr)
375    *(.literal.esp_cpu_compare_and_set .text.esp_cpu_compare_and_set)
376    *(.literal.esp_gpio_reserve_pins .text.esp_gpio_reserve_pins)
377    *(.literal.esp_gpio_is_pin_reserved .text.esp_gpio_is_pin_reserved)
378    *(.literal.rtc_vddsdio_get_config .text.rtc_vddsdio_get_config)
379    *(.literal.rtc_vddsdio_set_config .text.rtc_vddsdio_set_config)
380    *libzephyr.a:esp_memory_utils.*(.literal .literal.* .text .text.*)
381    *libzephyr.a:rtc_clk.*(.literal .literal.* .text .text.*)
382    *libzephyr.a:rtc_clk_init.*(.literal .text .literal.* .text.*)
383    *libzephyr.a:rtc_sleep.*(.literal .literal.* .text .text.*)
384    *libzephyr.a:rtc_time.*(.literal .literal.* .text .text.*)
385    *libzephyr.a:systimer.*(.literal .literal.* .text .text.*)
386    *libzephyr.a:mspi_timing_config.*(.literal .literal.* .text .text.*)
387    *libzephyr.a:mspi_timing_tuning.*(.literal .literal.* .text .text.*)
388    *(.literal.sar_periph_ctrl_power_enable .text.sar_periph_ctrl_power_enable)
389
390    /* [mapping:soc_pm] */
391    *(.literal.GPIO_HOLD_MASK .text.GPIO_HOLD_MASK)
392
393    /* [mapping:esp_rom] */
394    *libzephyr.a:esp_rom_cache_esp32s2_esp32s3.*(.literal .literal.* .text .text.*)
395    *libzephyr.a:cache_utils.*(.literal .text .literal.* .text.*)
396    *libzephyr.a:esp_rom_spiflash.*(.literal .literal.* .text .text.*)
397    *libzephyr.a:esp_rom_systimer.*(.literal .literal.* .text .text.*)
398    *libzephyr.a:esp_rom_wdt.*(.literal .literal.* .text .text.*)
399    *libzephyr.a:esp_rom_efuse.*(.literal .literal.* .text .text.*)
400
401    /* [mapping:esp_mm] */
402    *libzephyr.a:esp_cache.*(.literal .literal.* .text .text.*)
403
404#if defined(CONFIG_ESP32_WIFI_IRAM_OPT)
405    *libnet80211.a:(.wifi0iram  .wifi0iram.* .wifislpiram .wifislpiram.* .wifiextrairam .wifiextrairam.*)
406    *libpp.a:(.wifi0iram  .wifi0iram.* .wifislpiram .wifislpiram.* .wifiorslpiram .wifiorslpiram.* .wifiextrairam .wifiextrairam.*)
407    *libcoexist.a:(.wifi_slp_iram  .wifi_slp_iram.*)
408
409    /* [mapping:esp_wifi] */
410    *(.literal.wifi_clock_enable_wrapper .text.wifi_clock_enable_wrapper)
411    *(.literal.wifi_clock_disable_wrapper .text.wifi_clock_disable_wrapper)
412
413    /* [mapping:esp_phy] */
414    *(.literal.esp_phy_enable .text.esp_phy_enable)
415    *(.literal.esp_phy_disable .text.esp_phy_disable)
416    *(.literal.esp_wifi_bt_power_domain_off .text.esp_wifi_bt_power_domain_off)
417#endif
418
419#if defined(CONFIG_ESP32_WIFI_RX_IRAM_OPT)
420    *libnet80211.a:( .wifirxiram  .wifirxiram.* .wifislprxiram .wifislprxiram.*)
421    *libpp.a:( .wifirxiram  .wifirxiram.* .wifislprxiram .wifislprxiram.*)
422#endif
423    . = ALIGN(4);
424
425  } GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
426
427#ifdef CONFIG_ESP_SIMPLE_BOOT
428  .loader.text :
429  {
430    . =  ALIGN(4);
431    _loader_text_start = ABSOLUTE(.);
432    *libzephyr.a:bootloader_clock_init.*(.literal .text .literal.* .text.*)
433    *libzephyr.a:bootloader_wdt.*(.literal .text .literal.* .text.*)
434    *libzephyr.a:bootloader_flash.*(.literal .text .literal.* .text.*)
435    *libzephyr.a:bootloader_flash_config_esp32s3.*(.literal .text .literal.* .text.*)
436    *libzephyr.a:bootloader_clock_loader.*(.literal .text .literal.* .text.*)
437    *libzephyr.a:bootloader_efuse.*(.literal .text .literal.* .text.*)
438    *libzephyr.a:bootloader_utility.*(.literal .text .literal.* .text.*)
439    *libzephyr.a:bootloader_sha.*(.literal .text .literal.* .text.*)
440    *libzephyr.a:bootloader_panic.*(.literal .text .literal.* .text.*)
441
442    *libzephyr.a:esp_image_format.*(.literal .text .literal.* .text.*)
443    *libzephyr.a:flash_encrypt.*(.literal .text .literal.* .text.*)
444    *libzephyr.a:flash_encryption_secure_features.*(.literal .text .literal.* .text.*)
445    *libzephyr.a:flash_partitions.*(.literal .text .literal.* .text.*)
446    *libzephyr.a:flash_qio_mode.*(.literal .text .literal.* .text.*)
447    *libzephyr.a:spi_flash_hal.*(.literal .literal.* .text .text.*)
448    *libzephyr.a:spi_flash_hal_common.*(.literal .literal.* .text .text.*)
449    *libzephyr.a:esp_flash_api.*(.literal .text .literal.* .text.*)
450    *libzephyr.a:esp_flash_spi_init.*(.literal .text .literal.* .text.*)
451
452    *libzephyr.a:secure_boot.*(.literal .text .literal.* .text.*)
453    *libzephyr.a:secure_boot_secure_features.*(.literal .text .literal.* .text.*)
454    *libzephyr.a:secure_boot_signatures_bootloader.*(.literal .text .literal.* .text.*)
455    *libzephyr.a:esp_efuse_table.*(.literal .text .literal.* .text.*)
456    *libzephyr.a:esp_efuse_fields.*(.literal .text .literal.* .text.*)
457    *libzephyr.a:esp_efuse_api.*(.literal .text .literal.* .text.*)
458    *libzephyr.a:esp_efuse_utility.*(.literal .text .literal.* .text.*)
459    *libzephyr.a:esp_efuse_api_key_esp32xx.*(.literal .text .literal.* .text.*)
460    *libzephyr.a:mpu_hal.*(.literal .text .literal.* .text.*)
461    *libzephyr.a:cpu_region_protect.*(.literal .text .literal.* .text.*)
462
463    *(.fini.literal)
464    *(.fini)
465
466    . = ALIGN(4);
467    _loader_text_end = ABSOLUTE(.);
468  } GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
469#endif /* CONFIG_ESP_SIMPLE_BOOT */
470
471  /* Marks the end of IRAM code segment */
472  .iram0.text_end (NOLOAD) :
473  {
474    /* ESP32-S3 memprot requires 16B padding for possible CPU prefetch and 256B alignment for PMS split lines */
475    . = ALIGN(4) + 16;
476    _iram_text_end = ABSOLUTE(.);
477  } GROUP_LINK_IN(IRAM_REGION)
478
479  .iram0.data :
480  {
481    . = ALIGN(4);
482    _iram_data_start = ABSOLUTE(.);
483    *(.iram.data)
484    *(.iram.data*)
485    _iram_data_end = ABSOLUTE(.);
486  } GROUP_DATA_LINK_IN(IRAM_REGION, ROMABLE_REGION)
487
488  .iram0.bss (NOLOAD) :
489  {
490    . = ALIGN(4);
491    _iram_bss_start = ABSOLUTE(.);
492    *(.iram.bss)
493    *(.iram.bss*)
494    _iram_bss_end = ABSOLUTE(.);
495    . = ALIGN(4);
496    _iram_end = ABSOLUTE(.);
497  } GROUP_LINK_IN(IRAM_REGION)
498
499  /* --- END OF IRAM --- */
500
501  /* --- START OF DRAM --- */
502
503  .dram0.dummy (NOLOAD):
504  {
505    /* Spacer section is required to skip .iram0.text area because
506     * iram0_0_seg and dram0_0_seg reflect the same address space on different buses.
507     */
508    . = ORIGIN(dram0_0_seg) + MAX(_iram_end, SRAM1_IRAM_START) - SRAM1_IRAM_START;
509    . = ALIGN(4) + 16;
510  } GROUP_LINK_IN(RAMABLE_REGION)
511
512  .dram0.data :
513  {
514    . = ALIGN (8);
515    _data_start = ABSOLUTE(.);
516    __data_start = ABSOLUTE(.);
517
518    /*  bluetooth library requires this symbol to be defined */
519    _btdm_data_start = ABSOLUTE(.);
520    *libbtdm_app.a:(.data .data.*)
521    . = ALIGN (4);
522    _btdm_data_end = ABSOLUTE(.);
523
524    *(.data)
525    *(.data.*)
526    *(.gnu.linkonce.d.*)
527    *(.data1)
528    *(.sdata)
529    *(.sdata.*)
530    *(.gnu.linkonce.s.*)
531    *(.sdata2)
532    *(.sdata2.*)
533    *(.gnu.linkonce.s2.*)
534    *(.srodata)
535    *(.srodata.*)
536    /* rodata for panic handler(libarch__xtensa__core.a) and all
537     * dependent functions should be placed in DRAM to avoid issue
538     * when flash cache is disabled */
539    *libarch__xtensa__core.a:(.rodata .rodata.*)
540    *libkernel.a:fatal.*(.rodata .rodata.*)
541    *libkernel.a:init.*(.rodata .rodata.*)
542    *libzephyr.a:cbprintf_complete.*(.rodata .rodata.*)
543    *libzephyr.a:log_core.*(.rodata .rodata.*)
544    *libzephyr.a:log_backend_uart.*(.rodata .rodata.*)
545    *libzephyr.a:log_output.*(.rodata .rodata.*)
546    *libzephyr.a:log_minimal.*(.rodata .rodata.*)
547    *libzephyr.a:loader.*(.rodata .rodata.*)
548    *libzephyr.a:flash_init.*(.rodata .rodata.*)
549    *libzephyr.a:soc_flash_init.*(.rodata .rodata.*)
550    *libzephyr.a:console_init.*(.rodata .rodata.*)
551    *libzephyr.a:soc_init.*(.rodata .rodata.*)
552    *libzephyr.a:hw_init.*(.rodata .rodata.*)
553    *libzephyr.a:soc_random.*(.rodata .rodata.*)
554    *libdrivers__serial.a:uart_esp32.*(.rodata .rodata.*)
555    *libdrivers__flash.a:flash_esp32.*(.rodata .rodata.*)
556    *libzephyr.a:esp_mmu_map.*(.rodata .rodata.*)
557    *libdrivers__interrupt_controller.a:(.rodata .rodata.*)
558
559    /* APPCPU_ENABLE */
560    *libzephyr.a:esp32s3-mp.*(.rodata .rodata.*)
561    *libzephyr.a:bootloader_flash.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
562    *libzephyr.a:flash_mmap.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
563
564    /* [mapping:esp_psram] */
565    *libzephyr.a:mmu_psram_flash.*(.rodata .rodata.*)
566    *libzephyr.a:esp_psram_impl_octal.*(.rodata .rodata.*)
567    *libzephyr.a:esp_psram_impl_quad.*(.rodata .rodata.*)
568
569    /* [mapping:hal] */
570    *libzephyr.a:mmu_hal.*(.rodata .rodata.*)
571    *libzephyr.a:spi_flash_hal_iram.*(.rodata .rodata.*)
572    *libzephyr.a:spi_flash_encrypt_hal_iram.*(.rodata .rodata.*)
573    *libzephyr.a:cache_hal.*(.rodata .rodata.*)
574    *libzephyr.a:ledc_hal_iram.*(.rodata .rodata.*)
575    *libzephyr.a:i2c_hal_iram.*(.rodata .rodata.*)
576    *libzephyr.a:wdt_hal_iram.*(.rodata .rodata.*)
577    *libzephyr.a:systimer_hal.*(.rodata .rodata.*)
578    *libzephyr.a:spi_flash_hal_gpspi.*(.rodata .rodata.*)
579
580    /* [mapping:soc] */
581    *libzephyr.a:lldesc.*(.rodata .rodata.*)
582
583    /* [mapping:log] */
584    *(.rodata.esp_log_write)
585    *(.rodata.esp_log_timestamp)
586    *(.rodata.esp_log_early_timestamp)
587    *(.rodata.esp_log_impl_lock)
588    *(.rodata.esp_log_impl_lock_timeout)
589    *(.rodata.esp_log_impl_unlock)
590
591    /* [mapping:spi_flash] */
592    *libzephyr.a:spi_flash_chip_boya.*(.rodata .rodata.*)
593    *libzephyr.a:spi_flash_chip_gd.*(.rodata .rodata.*)
594    *libzephyr.a:spi_flash_chip_generic.*(.rodata .rodata.*)
595    *libzephyr.a:spi_flash_chip_issi.*(.rodata .rodata.*)
596    *libzephyr.a:spi_flash_chip_mxic.*(.rodata .rodata.*)
597    *libzephyr.a:spi_flash_chip_mxic_opi.*(.rodata .rodata.*)
598    *libzephyr.a:spi_flash_chip_th.*(.rodata .rodata.*)
599    *libzephyr.a:spi_flash_chip_winbond.*(.rodata .rodata.*)
600    *libzephyr.a:memspi_host_driver.*(.rodata .rodata.*)
601    *libzephyr.a:flash_brownout_hook.*(.rodata .rodata.*)
602    *libzephyr.a:spi_flash_wrap.*(.rodata .rodata.*)
603    *libzephyr.a:spi_flash_hpm_enable.*(.rodata .rodata.*)
604    *libzephyr.a:spi_flash_oct_flash_init.*(.rodata .rodata.*)
605    *libzephyr.a:flash_qio_mode.*(.rodata .rodata.*)
606    *libzephyr.a:flash_ops.*(.rodata .rodata.*)
607
608    /* [mapping:esp_mm] */
609    *libzephyr.a:esp_cache.*(.rodata .rodata.*)
610
611    /* [mapping:esp_hw_support] */
612    *(.rodata.esp_cpu_stall)
613    *(.rodata.esp_cpu_unstall)
614    *(.rodata.esp_cpu_reset)
615    *(.rodata.esp_cpu_wait_for_intr)
616    *(.rodata.esp_cpu_compare_and_set)
617    *(.rodata.esp_gpio_reserve_pins)
618    *(.rodata.esp_gpio_is_pin_reserved)
619    *(.rodata.rtc_vddsdio_get_config)
620    *(.rodata.rtc_vddsdio_set_config)
621    *libzephyr.a:esp_memory_utils.*(.rodata .rodata.*)
622    *libzephyr.a:rtc_clk.*(.rodata .rodata.*)
623    *libzephyr.a:rtc_clk_init.*(.rodata .rodata.*)
624    *libzephyr.a:systimer.*(.rodata .rodata.*)
625    *libzephyr.a:mspi_timing_config.*(.rodata .rodata.*)
626    *libzephyr.a:mspi_timing_tuning.*(.rodata .rodata.*)
627    *(.rodata.sar_periph_ctrl_power_enable)
628
629    /* [mapping:soc_pm] */
630    *(.rodata.GPIO_HOLD_MASK)
631
632    /* [mapping:esp_rom] */
633    *libzephyr.a:esp_rom_cache_esp32s2_esp32s3.*(.rodata .rodata.*)
634    *libzephyr.a:cache_utils.*(.rodata .rodata.*)
635    *libzephyr.a:esp_rom_spiflash.*(.rodata .rodata.*)
636    *libzephyr.a:esp_rom_systimer.*(.rodata .rodata.*)
637    *libzephyr.a:esp_rom_wdt.*(.rodata .rodata.*)
638    *libzephyr.a:esp_rom_efuse.*(.rodata .rodata.*)
639
640    /* [mapping:esp_system] */
641    *libzephyr.a:esp_err.*(.rodata .rodata.*)
642    *(.rodata.esp_system_abort)
643
644#if defined(CONFIG_ESP32_WIFI_IRAM_OPT)
645    /* [mapping:esp_wifi] */
646    *(.rodata.wifi_clock_enable_wrapper)
647    *(.rodata.wifi_clock_disable_wrapper)
648
649    /* [mapping:esp_phy] */
650    *(.rodata.esp_phy_enable)
651    *(.rodata.esp_phy_disable)
652    *(.rodata.esp_wifi_bt_power_domain_off)
653#endif
654
655    . = ALIGN(4);
656    #include <snippets-rwdata.ld>
657    . = ALIGN(4);
658
659    KEEP(*(.jcr))
660    *(.dram1 .dram1.*)
661    . = ALIGN(4);
662  } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
663
664#ifdef CONFIG_ESP_SIMPLE_BOOT
665  .loader.data :
666  {
667    . = ALIGN(4);
668    _loader_data_start = ABSOLUTE(.);
669    *libzephyr.a:bootloader_clock_init.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
670    *libzephyr.a:bootloader_wdt.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
671    *libzephyr.a:bootloader_flash.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
672    *libzephyr.a:bootloader_efuse.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
673
674    *libzephyr.a:cpu_util.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
675    *libzephyr.a:clk.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
676    *libzephyr.a:esp_clk.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
677    *libzephyr.a:cpu_region_protect.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
678
679    *libzephyr.a:spi_flash_hal.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
680    *libzephyr.a:spi_flash_hal_common.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
681    *libzephyr.a:esp_flash_api.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
682    *libzephyr.a:esp_flash_spi_init.*(.rodata .rodata.* .sdata2 .sdata2.* .srodata .srodata.*)
683
684    . = ALIGN(4);
685    _loader_data_end = ABSOLUTE(.);
686  } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
687#endif /* CONFIG_ESP_SIMPLE_BOOT */
688
689  #include <snippets-data-sections.ld>
690  #include <zephyr/linker/common-ram.ld>
691  #include <snippets-ram-sections.ld>
692  #include <zephyr/linker/cplusplus-ram.ld>
693  #include <zephyr/linker/kobject-data.ld>
694
695  /* logging sections should be placed in RAM area to avoid flash cache disabled issues */
696  #pragma push_macro("GROUP_ROM_LINK_IN")
697  #undef GROUP_ROM_LINK_IN
698  #define GROUP_ROM_LINK_IN GROUP_DATA_LINK_IN
699  #include <zephyr/linker/common-rom/common-rom-logging.ld>
700  #pragma pop_macro("GROUP_ROM_LINK_IN")
701
702  .dram0.end :
703  {
704    __data_end = ABSOLUTE(.);
705    _data_end = ABSOLUTE(.);
706  } GROUP_DATA_LINK_IN(RAMABLE_REGION, ROMABLE_REGION)
707
708  .dram0.noinit (NOLOAD):
709  {
710    . = ALIGN(4);
711    __dram_noinit_start = ABSOLUTE(.);
712#ifdef CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM
713    *(EXCLUDE_FILE(
714      *libdrivers__wifi.a:*
715      *libsubsys__net__l2__ethernet.a:*
716      *libsubsys__net__lib__config.a:*
717      *libsubsys__net__ip.a:*
718      *libsubsys__net.a:* ) .noinit)
719    *(EXCLUDE_FILE(
720      *libdrivers__wifi.a:*
721      *libsubsys__net__l2__ethernet.a:*
722      *libsubsys__net__lib__config.a:*
723      *libsubsys__net__ip.a:*
724      *libsubsys__net.a:* ) .noinit.*)
725#else
726    *(.noinit)
727    *(.noinit.*)
728#endif /* CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM */
729    __dram_noinit_end = ABSOLUTE(.);
730    . = ALIGN(4) ;
731  } GROUP_LINK_IN(RAMABLE_REGION)
732
733  /* Shared RAM */
734  .dram0.bss (NOLOAD) :
735  {
736    . = ALIGN (8);
737    _bss_start = ABSOLUTE(.); /* required by bluetooth library */
738    __bss_start = ABSOLUTE(.);
739
740    /*  bluetooth library requires this symbol to be defined */
741    _btdm_bss_start = ABSOLUTE(.);
742    *libbtdm_app.a:(.bss .bss.* COMMON)
743    . = ALIGN (4);
744    _btdm_bss_end = ABSOLUTE(.);
745
746    *(.dynsbss)
747    *(.sbss)
748    *(.sbss.*)
749    *(.gnu.linkonce.sb.*)
750    *(.scommon)
751    *(.sbss2)
752    *(.sbss2.*)
753    *(.gnu.linkonce.sb2.*)
754    *(.dynbss)
755    *(.bss)
756    *(.bss.*)
757    *(.share.mem)
758    *(.gnu.linkonce.b.*)
759    *(COMMON)
760    . = ALIGN (8);
761    _bss_end = ABSOLUTE(.);
762    __bss_end = ABSOLUTE(.);
763  } GROUP_LINK_IN(RAMABLE_REGION)
764
765  /* Provide total SRAM usage, including IRAM and DRAM */
766  _image_ram_start = _init_start - IRAM_DRAM_OFFSET;
767  #include <zephyr/linker/ram-end.ld>
768
769  ASSERT(((_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)), "DRAM segment data does not fit.")
770
771  /* --- END OF DRAM --- */
772
773  /* --- START OF IROM --- */
774
775  /* Symbols used during the application memory mapping */
776  _image_irom_start = LOADADDR(.flash.text);
777  _image_irom_size = LOADADDR(.flash.text) + SIZEOF(.flash.text) - _image_irom_start;
778  _image_irom_vaddr = ADDR(.flash.text);
779
780  /* Align next section to 64k to allow mapping */
781  .flash.text_dummy (NOLOAD) :
782  {
783    . = ALIGN(CACHE_ALIGN);
784  } GROUP_LINK_IN(ROMABLE_REGION)
785
786  .flash.text : ALIGN(0x10)
787  {
788    _stext = .;
789    _instruction_reserved_start = ABSOLUTE(.);
790    _text_start = ABSOLUTE(.);
791    __text_region_start = ABSOLUTE(.);
792    __rom_region_start = ABSOLUTE(.);
793
794#if !defined(CONFIG_ESP32_WIFI_IRAM_OPT)
795    *libnet80211.a:( .wifi0iram  .wifi0iram.* .wifislpiram .wifislpiram.* .wifiextrairam .wifiextrairam.*)
796    *libpp.a:( .wifi0iram  .wifi0iram.* .wifislpiram .wifislpiram.* .wifiorslpiram .wifiorslpiram.* .wifiextrairam .wifiextrairam.*)
797#endif
798
799#if !defined(CONFIG_ESP32_WIFI_RX_IRAM_OPT)
800    *libnet80211.a:( .wifirxiram  .wifirxiram.* .wifislprxiram .wifislprxiram.*)
801    *libpp.a:( .wifirxiram  .wifirxiram.* .wifislprxiram .wifislprxiram.*)
802#endif
803
804    *(.stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
805    *(.irom0.text) /* catch stray ICACHE_RODATA_ATTR */
806    *(.fini.literal)
807    *(.fini)
808    *(.gnu.version)
809    *(.literal .text .literal.* .text.*)
810
811    /* CPU will try to prefetch up to 16 bytes of
812     * of instructions. This means that any configuration (e.g. MMU, PMS) must allow
813     * safe access to up to 16 bytes after the last real instruction, add
814     * dummy bytes to ensure this
815     */
816    . += 16;
817
818    _text_end = ABSOLUTE(.);
819    _instruction_reserved_end = ABSOLUTE(.);  /* This is a symbol marking the flash.text end, this can be used for mmu driver to maintain virtual address */
820    __text_region_end = ABSOLUTE(.);
821    __rom_region_end = ABSOLUTE(.);
822    _etext = .;
823
824  } GROUP_DATA_LINK_IN(FLASH_CODE_REGION, ROMABLE_REGION)
825
826  /* --- END OF IROM --- */
827
828  /* --- START OF DROM --- */
829
830  /* This dummy section represents the .flash.text section but in default_rodata_seg.
831   * Thus, it must have its alignment and (at least) its size.
832   */
833  .flash.rodata_dummy (NOLOAD):
834  {
835    _flash_rodata_dummy_start = ABSOLUTE(.);
836    . += SIZEOF(.flash.text);
837    . = ALIGN(CACHE_ALIGN);
838  } GROUP_LINK_IN(RODATA_REGION)
839
840  _image_drom_start = LOADADDR(.flash.rodata);
841  _image_drom_size = LOADADDR(.flash.rodata_end) + SIZEOF(.flash.rodata_end) - _image_drom_start;
842  _image_drom_vaddr = ADDR(.flash.rodata);
843
844  .flash.rodata : ALIGN(CACHE_ALIGN)
845  {
846    _image_rodata_start = ABSOLUTE(.);
847    _rodata_reserved_start = ABSOLUTE(.);  /* This is a symbol marking the flash.rodata start, this can be used for mmu driver to maintain virtual address */
848    _rodata_start = ABSOLUTE(.);
849    __rodata_region_start = ABSOLUTE(.);
850
851    . = ALIGN(4);
852    #include <snippets-rodata.ld>
853
854    *(.irom1.text) /* catch stray ICACHE_RODATA_ATTR */
855    *(.gnu.linkonce.r.*)
856    *(.rodata)
857    *(.rodata.*)
858    *(.rodata1)
859    __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
860    *(.xt_except_table)
861    *(.gcc_except_table .gcc_except_table.*)
862    *(.gnu.linkonce.e.*)
863    *(.gnu.version_r)
864    . = (. + 3) & ~ 3;
865    __eh_frame = ABSOLUTE(.);
866    KEEP(*(.eh_frame))
867    . = (. + 7) & ~ 3;
868
869    /*  C++ exception handlers table:  */
870    __XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
871    *(.xt_except_desc)
872    *(.gnu.linkonce.h.*)
873    __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
874    *(.xt_except_desc_end)
875    *(.dynamic)
876    *(.gnu.version_d)
877    . = ALIGN(4);
878    __rodata_region_end = ABSOLUTE(.);
879    /* Literals are also RO data. */
880    _lit4_start = ABSOLUTE(.);
881    *(*.lit4)
882    *(.lit4.*)
883    *(.gnu.linkonce.lit4.*)
884    _lit4_end = ABSOLUTE(.);
885    . = ALIGN(4);
886    *(.rodata_wlog)
887    *(.rodata_wlog*)
888    . = ALIGN(4);
889  } GROUP_DATA_LINK_IN(RODATA_REGION, ROMABLE_REGION)
890
891  #include <zephyr/linker/cplusplus-rom.ld>
892  #include <zephyr/linker/common-rom/common-rom-init.ld>
893  #include <zephyr/linker/common-rom/common-rom-kernel-devices.ld>
894  #include <zephyr/linker/common-rom/common-rom-ztest.ld>
895  #include <zephyr/linker/common-rom/common-rom-net.ld>
896  #include <zephyr/linker/common-rom/common-rom-bt.ld>
897  #include <zephyr/linker/common-rom/common-rom-debug.ld>
898  #include <zephyr/linker/common-rom/common-rom-misc.ld>
899  #include <zephyr/linker/thread-local-storage.ld>
900  #include <snippets-sections.ld>
901
902  /* Create an explicit section at the end of all the data that shall be mapped into drom.
903   * This is used to calculate the size of the _image_drom_size variable */
904  .flash.rodata_end : ALIGN(0x10)
905  {
906    . = ALIGN(4);
907    _rodata_reserved_end = ABSOLUTE(.);
908    _image_rodata_end = ABSOLUTE(.);
909  } GROUP_DATA_LINK_IN(RODATA_REGION, ROMABLE_REGION)
910
911  /* --- END OF DROM --- */
912
913  /* --- START OF SPIRAM --- */
914
915  /**
916   * This section is required to skip flash rodata sections, because `ext_ram_seg`
917   * and `drom0_0_seg` are on the same bus
918   */
919#if defined(CONFIG_ESP_SPIRAM)
920
921  /* This section is required to skip flash rodata sections, because `ext_[id]ram_seg`
922   * and `drom0_0_seg` are on the same bus */
923  .ext_ram.dummy (NOLOAD):
924  {
925    . = ADDR(.flash.rodata_end) - ORIGIN(ext_dram_seg);
926    . = ALIGN (CACHE_ALIGN);
927  } GROUP_LINK_IN(ext_dram_seg)
928
929  /* This section holds .ext_ram.bss data, and will be put in PSRAM */
930  .ext_ram.bss (NOLOAD) :
931  {
932    _ext_ram_start = ABSOLUTE(.);
933    _ext_ram_noinit_start = ABSOLUTE(.);
934
935#ifdef CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM
936    *libdrivers__wifi.a:(.noinit .noinit.*)
937    *libsubsys__net__l2__ethernet.a:(.noinit .noinit.*)
938    *libsubsys__net__lib__config.a:(.noinit .noinit.*)
939    *libsubsys__net__ip.a:(.noinit .noinit.*)
940    *libsubsys__net.a:(.noinit .noinit.*)
941#endif /* CONFIG_ESP32_WIFI_NET_ALLOC_SPIRAM */
942    . = ALIGN(16);
943    _ext_ram_noinit_end = ABSOLUTE(.);
944
945    _ext_ram_bss_start = ABSOLUTE(.);
946    *(.ext_ram.bss*)
947    . = ALIGN(16);
948    _ext_ram_bss_end = ABSOLUTE(.);
949
950    _spiram_heap_start = ABSOLUTE(.);
951    . = . + CONFIG_ESP_SPIRAM_HEAP_SIZE - (_spiram_heap_start - _ext_ram_bss_start);
952    . = ALIGN(4);
953
954    _ext_ram_end = ABSOLUTE(.);
955  } GROUP_LINK_IN(ext_dram_seg)
956
957#endif /* CONFIG_ESP_SPIRAM */
958
959  /* --- END OF SPIRAM --- */
960
961  /* --- XTENSA GLUE AND DEBUG BEGIN --- */
962#ifdef CONFIG_GEN_ISR_TABLES
963#include <zephyr/linker/intlist.ld>
964#endif
965
966#include <zephyr/linker/debug-sections.ld>
967
968  .xtensa.info  0 :  { *(.xtensa.info) }
969  .xt.insn 0 :
970  {
971    KEEP (*(.xt.insn))
972    KEEP (*(.gnu.linkonce.x.*))
973  }
974  .xt.prop 0 :
975  {
976    KEEP (*(.xt.prop))
977    KEEP (*(.xt.prop.*))
978    KEEP (*(.gnu.linkonce.prop.*))
979  }
980  .xt.lit 0 :
981  {
982    KEEP (*(.xt.lit))
983    KEEP (*(.xt.lit.*))
984    KEEP (*(.gnu.linkonce.p.*))
985  }
986  .xt.profile_range 0 :
987  {
988    KEEP (*(.xt.profile_range))
989    KEEP (*(.gnu.linkonce.profile_range.*))
990  }
991  .xt.profile_ranges 0 :
992  {
993    KEEP (*(.xt.profile_ranges))
994    KEEP (*(.gnu.linkonce.xt.profile_ranges.*))
995  }
996  .xt.profile_files 0 :
997  {
998    KEEP (*(.xt.profile_files))
999    KEEP (*(.gnu.linkonce.xt.profile_files.*))
1000  }
1001
1002}
1003
1004  /* --- XTENSA GLUE AND DEBUG END --- */
1005
1006ASSERT(((_iram_end - ORIGIN(iram0_0_seg)) <= LENGTH(iram0_0_seg)),
1007          "IRAM0 segment data does not fit.")
1008
1009ASSERT(((_end - ORIGIN(dram0_0_seg)) <= LENGTH(dram0_0_seg)),
1010          "DRAM segment data does not fit.")
1011
1012#if defined(CONFIG_ESP_SPIRAM)
1013ASSERT(((_ext_ram_end - _ext_ram_start) <= CONFIG_ESP_SPIRAM_SIZE),
1014          "External SPIRAM overflowed.")
1015#endif
1016