ENTRY(Reset_Handler)
/* link with the standard c library */
INPUT(-lc)
/* link with the standard GCC library */
INPUT(-lgcc)

MEMORY
{
    ram     :   ORIGIN = 0x00000000, LENGTH = 256K
    shared_memory (!rx) : ORIGIN = 0x60000000, len = 256K
    lamac_memory (!rx) : ORIGIN = 0x61100000, len = 1024K
    machw_mib_memory (!rx) : ORIGIN = 0x68300800, len = 4K
}

SECTIONS
{
    /* shared RAM */
    SHARED (NOLOAD):
    {
        _sshram = . ;
        *(SHAREDRAMIPC)
        *(SHAREDRAM)
        _eshram = . ;
        _trace_start = .;
        _trace_end = ORIGIN(shared_memory) + LENGTH(shared_memory);
    } > shared_memory

    /* MAC logic analyzer RAM */
    LA (NOLOAD):
    {
        _slarammac = . ;
        *(LARAM)
        _elarammac = . ;
    } > lamac_memory

    /* MAC HW MIBs */
    HW_MIB (NOLOAD):
    {
        _smachw_mib = . ;
        *(MACHWMIB)
        _emachw_mib = . ;
    } > machw_mib_memory

    .text :
    {
        KEEP(*(.vectors))
        KEEP(*(.cortex_vectors))
        KEEP(*(.vendor_vectors))
        *(.text*)
        *(.rodata*)
        _end_text = .;
    } > ram

    .data :
    {
        _start_data = .;
        *(.data*)
        _end_data = .;
    } > ram

    .bss :
    {
        _start_bss = .;
        *(.bss*)
        *(COMMON)
        _end_bss = .;
    } > ram

    . = ALIGN(4);

    _start_stack = .;
    PROVIDE(_end_stack = ORIGIN(ram) + LENGTH(ram));
}

_end = .;
