/**********************************************************
	File : ldscript 
	Author : Alain Greiner
	Date : January 2014
**********************************************************/

/* definition of the base address for all segments 
The peripherals base addresses are referenced by the
software drivers and must be defined, even if the 
peripherals are not present in the architecture */

seg_reset_base  = 0x10000000;       /* le code de boot */

seg_kcode_base  = 0x00001000;       /* le code du système */
seg_kdata_base  = 0x00010000;       /* les donnees du système */
seg_kunc_base   = 0x00020000;       /* les données non cachées du système */

seg_code_base   = 0x00030000;       /* le code utilisateur */ 
seg_data_base   = 0x00040000;       /* les données utilisateur */

seg_heap_base   = 0x00100000;       /* le tas utilisateur */
seg_stack_base  = 0x00400000;       /* la pile utilisateur */

seg_xcu_base    = 0xF0000000;       /* controleur XCU */
seg_dma_base    = 0xF1000000;       /* controleur DMA */
seg_tty_base    = 0xF2000000;       /* controleur TTY */
seg_fbf_base    = 0xF3000000;       /* controleur FBF */
seg_ioc_base    = 0xF4000000;       /* controleur IOC */


/* Grouping sections into segments */

SECTIONS
{
   . = seg_kcode_base;
   seg_kcode : {
      *(.giet)
      *(.switch)
      *(.drivers)
      *(.isr)
   } 
   . = seg_kdata_base;
   seg_kdata : {
      *(.kdata)
   } 
   . = seg_kunc_base;
   seg_kunc : {
      *(.unckdata)
   } 
   . = seg_kdata_base;
   seg_kdata : {
      *(.ksave)
   } 
   . = seg_code_base;
   seg_code : {
      *(.text)
   } 
   . = seg_reset_base;
   seg_reset : {
      *(.reset)
   } 
   . = seg_data_base;
   seg_data : {
      *(.rodata)
      . = ALIGN(4);
      *(.rodata.*)
      . = ALIGN(4);
      *(.data)
      . = ALIGN(4);
      *(.sdata)
      . = ALIGN(4);
      *(.bss)
      *(COMMON)
      *(.sbss)
   } 
}

