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