/*
 * Copyright (c) 2018 Renesas Electronics Corporation. All rights reserved.
 */


OUTPUT_FORMAT("elf32-littlearm")
OUTPUT_ARCH(arm)
ENTRY(Vector)

MEMORY {
    RAM (rwxa): ORIGIN = 0xEB200000, LENGTH = 0x000C0000
}


SECTIONS
{
    . = 0xEB200000;
    ASSERT(. == ALIGN(4096),
           "CR7 dummy rtos address is not aligned on a page boundary.")

    ro . : {
        __RO_START__ = .;
        *rtos.o(.text*)
        *rtos_main.o(.text*)
        . = NEXT(32768);
        *(.text*)
        *(.rodata*)
        __RO_END_UNALIGNED__ = .;
        /*
         * Memory page(s) mapped to this section will be marked as
         * read-only, executable.  No RW data from the next section must
         * creep in.  Ensure the rest of the current memory page is unused.
         */
        . = NEXT(4096);
        . = NEXT(16384);
        __RO_END__ = .;
    } >RAM

    .data . : {
        __DATA_START__ = .;
        *(.data*)
        __DATA_END__ = .;
    } >RAM

    stacks (NOLOAD) : ALIGN(16) {
        __STACKS_START__ = .;
        KEEP(*(tzfw_normal_stacks))
        __STACKS_END__ = .;
    } >RAM

    /*
     * The .bss section gets initialised to 0 at runtime.
     * Its base address must be 16-byte aligned.
     */
    .bss : ALIGN(16) {
        __BSS_START__ = .;
        *(SORT_BY_ALIGNMENT(.bss*))
        *(COMMON)
        __BSS_END__ = .;
    } >RAM

    __BSS_SIZE__ = SIZEOF(.bss);

    ASSERT(. <= 0xEB2FE800, "CR7 dummy rtos has exceeded its limit.")
}
