1 /* Copyright 2015-2018 Espressif Systems (Shanghai) PTE LTD
2 * Copyright 2018 apeos contributors
4 * Linker file used to link the bootloader.
6 * Licensed under the Apache License, Version 2.0 (the "License");
7 * you may not use this file except in compliance with the License.
8 * You may obtain a copy of the License at
10 * http://www.apache.org/licenses/LICENSE-2.0
12 * Unless required by applicable law or agreed to in writing, software
13 * distributed under the License is distributed on an "AS IS" BASIS,
14 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 * See the License for the specific language governing permissions and
16 * limitations under the License. */
18 /* Simplified memory map for the bootloader
20 The main purpose is to make sure the bootloader can load into main memory
21 without overwriting itself.
26 dport0_seg (RW) : org = 0x3FF00000, len = 0x10
27 /* IRAM POOL1, used for APP CPU cache. We can abuse it in bootloader because APP CPU is still held in reset, the main app enables APP CPU cache */
28 iram_seg (RWX) : org = 0x40078000, len = 0x8000
29 /* 64k at the end of DRAM, after ROM bootloader stack */
30 dram_seg (RW) : org = 0x3FFF0000, len = 0x10000
33 /* Default entry point: */
52 _bss_start = ABSOLUTE(.);
60 *(.gnu.linkonce.sb2.*)
67 _bss_end = ABSOLUTE(.);
72 _data_start = ABSOLUTE(.);
84 _data_end = ABSOLUTE(.);
89 _rodata_start = ABSOLUTE(.);
94 __XT_EXCEPTION_TABLE_ = ABSOLUTE(.);
101 /* C++ constructor and destructor tables, properly ordered: */
102 __init_array_start = ABSOLUTE(.);
103 KEEP (*crtbegin.o(.ctors))
104 KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
105 KEEP (*(SORT(.ctors.*)))
107 __init_array_end = ABSOLUTE(.);
108 KEEP (*crtbegin.o(.dtors))
109 KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
110 KEEP (*(SORT(.dtors.*)))
112 /* C++ exception handlers table: */
113 __XT_EXCEPTION_DESCS_ = ABSOLUTE(.);
116 __XT_EXCEPTION_DESCS_END__ = ABSOLUTE(.);
117 *(.xt_except_desc_end)
120 _rodata_end = ABSOLUTE(.);
121 /* Literals are also RO data. */
122 _lit4_start = ABSOLUTE(.);
125 *(.gnu.linkonce.lit4.*)
126 _lit4_end = ABSOLUTE(.);
128 _heap_start = ABSOLUTE(.);
134 _text_start = ABSOLUTE(.);
135 *(.literal .text .literal.* .text.* .stub .gnu.warning .gnu.linkonce.literal.* .gnu.linkonce.t.*.literal .gnu.linkonce.t.*)
136 *(.iram1 .iram1.*) /* catch stray IRAM_ATTR */
140 _text_end = ABSOLUTE(.);