Home | History | Annotate | Line # | Download | only in SMDK2800_flash_0x00000000
      1 /*	$NetBSD: ldscript,v 1.5 2012/08/06 02:14:16 matt Exp $	*/
      2 
      3 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
      4 	      "elf32-littlearm")
      5 
      6 OUTPUT_ARCH(arm)
      7 ENTRY(FLASH)
      8 
      9 MEMORY
     10 {
     11   /* We will locate the .text section in flash, and will run directly
     12      from there just long enough to relocate our .text and .data into
     13      a small chunk of SDRAM starting at (SDRAM + 1M).  */
     14   flash : o = 0x00000000, l = 16M
     15   sdram : o = 0x08000000, l = 1M	/* kernel loads at 0x08200000 */
     16 }
     17 
     18 SECTIONS
     19 {
     20   FLASH = 0x00000000;
     21   SDRAM = 0x08000000;
     22 
     23   /DISCARD/ : { *(.ARM.attributes*) *(.ARM.exidx) }
     24 
     25   /* Read-only sections, merged into text segment: */
     26   /* __text_store = FLASH; */
     27   .text      :
     28   AT (FLASH)
     29   {
     30     *(.vectors)
     31     __text_store = . - SDRAM;
     32     *(.text)
     33     *(.text.*)
     34     *(.stub)
     35     *(.glue_7t) *(.glue_7)
     36     *(.rodata) *(.rodata.*)
     37   } > sdram = 0
     38   PROVIDE (__etext = .);
     39   PROVIDE (_etext = .);
     40   PROVIDE (etext = .);
     41   __data_store = FLASH + SIZEOF(.text);
     42   .data    :
     43   AT (LOADADDR(.text) + SIZEOF(.text))
     44   {
     45     __data_start = . ;
     46     *(.data)
     47     *(.data.*)
     48   } > sdram
     49   .sdata     :
     50   AT (LOADADDR(.data) + SIZEOF(.data))
     51   {
     52     *(.sdata)
     53     *(.sdata.*)
     54     . = ALIGN(32 / 8);
     55   } > sdram
     56   _edata = .;
     57   PROVIDE (edata = .);
     58   __bss_start = .;
     59   __bss_start__ = .;
     60   .sbss      :
     61   AT (ADDR(.sbss))
     62   {
     63     PROVIDE (__sbss_start = .);
     64     PROVIDE (___sbss_start = .);
     65     *(.dynsbss)
     66     *(.sbss)
     67     *(.sbss.*)
     68     *(.scommon)
     69     PROVIDE (__sbss_end = .);
     70     PROVIDE (___sbss_end = .);
     71   } > sdram
     72   .bss       :
     73   AT (ADDR(.bss))
     74   {
     75     *(.dynbss)
     76     *(.bss)
     77     *(.bss.*)
     78     *(COMMON)
     79     /* Align here to ensure that the .bss section occupies space up to
     80        _end.  Align after .bss to ensure correct alignment even if the
     81        .bss section disappears because there are no input sections.  */
     82     . = ALIGN(32 / 8);
     83   } > sdram
     84   . = ALIGN(32 / 8);
     85   _end = .;
     86   _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
     87   PROVIDE (end = .);
     88   /* .image   (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) : */
     89   .image   (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) :
     90   AT (LOADADDR(.sdata) + SIZEOF(.sdata))
     91   {
     92     *(.image)
     93   }
     94 
     95   __rom_size__ = LOADADDR(.image) + SIZEOF(.image);
     96 }
     97 
     98