#include "config.h"

ENTRY(start)
OUTPUT_FORMAT(set output format here as elf32-littlearm)
OUTPUT_ARCH(set output arch here)
STARTUP(path/to/crt0.o)

#define DRAMORIG 0x60700000
#define DRAMSIZE (MEMORYSIZE * 0x100000)

MEMORY
{
    DRAM  : ORIGIN = DRAMORIG, LENGTH = DRAMSIZE
}


SECTIONS
{
  .text : {
    *(.init.text)
    *(.text*)
    *(.icode*)
  } > DRAM

  .rodata : {
    *(.rodata*)
    *(.irodata*)
    . = ALIGN(0x4);
  } > DRAM

  .data : {
    *(.data*)
    *(.idata*)
    . = ALIGN(0x4);
  } > DRAM

  .stack (NOLOAD) :
  {
     *(.stack)
     _stackbegin = .;
     stackbegin = .;
     . += 0x2000;
     _stackend = .;
     stackend = .;
     _irqstackbegin = .;
     . += 0x400;
     _irqstackend = .;
     _fiqstackbegin = .;
     . += 0x400;
     _fiqstackend = .;
  } > DRAM