
#include <cyg/infra/cyg_type.inc>

MEMORY
{
  rom          : ORIGIN = 0x00000000, LENGTH = 0x0006ffff   /* internal flash */
  ram(WA)      : ORIGIN = 0x00400000, LENGTH = 0x000fffff   /* external RAM   */
  iram(WA)     : ORIGIN = 0x003f9800, LENGTH = 0x00006800   /* internal RAM   */
  eflash(RXIW) : ORIGIN = 0x00800000, LENGTH = 0x001fffff   /* external FLASH */
}

SECTIONS
{
    SECTIONS_BEGIN

    CYG_LABEL_DEFN(__reserved_vectors) = 0x00000000;

    SECTION_vectors          (rom, 0x00000000,   LMA_EQ_VMA)
    SECTION_text             (rom, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_fini             (rom, ALIGN (0x8),  LMA_EQ_VMA)
    SECTION_rodata1          (rom, ALIGN (0x8),  LMA_EQ_VMA)
    SECTION_rodata           (rom, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_fixup            (rom, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_gcc_except_table (rom, ALIGN (0x1),  LMA_EQ_VMA)

    . = 0x3f9800;
    CYG_LABEL_DEFN(__reserved_vsr_table) = ALIGN (0x10);
    . = CYG_LABEL_DEFN(__reserved_vsr_table) + 0x200;
    CYG_LABEL_DEFN(__reserved_virtual_table) = ALIGN (0x10);
    . = CYG_LABEL_DEFN(__reserved_virtual_table) + 0x100;

    SECTION_data             (iram, ALIGN (0x10), FOLLOWING (.gcc_except_table))
    SECTION_sbss             (iram, ALIGN (0x4),  LMA_EQ_VMA)
    SECTION_bss              (iram, ALIGN (0x10), LMA_EQ_VMA)

    . = 0x400000;

    CYG_LABEL_DEFN(__heap1) = ALIGN(0x8);

    SECTIONS_END
}
