esp-hal/esp32c3-hal/ld/mb-esp32c3-link.x
Gustavo Henrique Nihei 5cca83ca51 esp32c3: Set entry point address on MCUboot image header
Previously it assumed that the entry point was allocated at the
beginning of the ".rwtext" output section, which is not always true.

Signed-off-by: Gustavo Henrique Nihei <gustavo.nihei@espressif.com>
2022-10-24 09:52:46 -03:00

46 lines
971 B
Plaintext

INCLUDE memory.x
SECTIONS
{
.metadata :
{
/* Magic for load header */
LONG(0xace637d3)
/* Application entry point address */
KEEP(*(.entry_addr))
/* IRAM metadata:
* - Destination address (VMA) for IRAM region
* - Flash offset (LMA) for start of IRAM region
* - Size of IRAM region
*/
LONG(ADDR(.rwtext))
LONG(LOADADDR(.rwtext))
LONG(SIZEOF(.rwtext))
/* DRAM metadata:
* - Destination address (VMA) for DRAM region
* - Flash offset (LMA) for start of DRAM region
* - Size of DRAM region
*/
LONG(ADDR(.data))
LONG(LOADADDR(.data))
LONG(SIZEOF(.data))
} > metadata
}
INCLUDE riscv-link.x
_image_drom_vma = ADDR(.rodata);
_image_drom_lma = LOADADDR(.rodata);
_image_drom_size = LOADADDR(.rodata) + SIZEOF(.rodata) - _image_drom_lma;
_image_irom_vma = ADDR(.text);
_image_irom_lma = LOADADDR(.text);
_image_irom_size = LOADADDR(.text) + SIZEOF(.text) - _image_irom_lma;