11.6Smatt/*	$NetBSD: ldscript,v 1.6 2012/08/06 02:14:15 matt Exp $	*/
21.1Sthorpej
31.1SthorpejOUTPUT_ARCH(arm)
41.1SthorpejENTRY(FLASH)
51.1SthorpejMEMORY
61.1Sthorpej{
71.1Sthorpej  /* We will locate the .text section in flash, and will run directly
81.1Sthorpej     from there just long enough to relocate our .text and .data into
91.1Sthorpej     a small chunk of SDRAM starting at (SDRAM + 1M).  */
101.1Sthorpej  flash : o = 0x00140000, l = 2816K	/* 4M total flash */
111.1Sthorpej  sdram : o = 0xc0100000, l = 1M	/* kernel loads at 0xc0200000 */
121.1Sthorpej}
131.1SthorpejSECTIONS
141.1Sthorpej{
151.1Sthorpej  FLASH = 0x00140000;
161.1Sthorpej
171.6Smatt  /DISCARD/ : { *(.ARM.attributes*) *(.ARM.exidx) }
181.6Smatt
191.1Sthorpej  /* Read-only sections, merged into text segment: */
201.1Sthorpej  __text_store = FLASH;
211.1Sthorpej  .text      :
221.1Sthorpej  AT (FLASH)
231.1Sthorpej  {
241.1Sthorpej    *(.text)
251.1Sthorpej    *(.text.*)
261.1Sthorpej    *(.stub)
271.1Sthorpej    *(.glue_7t) *(.glue_7)
281.1Sthorpej    *(.rodata) *(.rodata.*)
291.1Sthorpej  } > sdram =0
301.1Sthorpej  PROVIDE (__etext = .);
311.1Sthorpej  PROVIDE (_etext = .);
321.1Sthorpej  PROVIDE (etext = .);
331.1Sthorpej  __data_store = FLASH + SIZEOF(.text);
341.1Sthorpej  .data    :
351.1Sthorpej  AT (LOADADDR(.text) + SIZEOF(.text))
361.1Sthorpej  {
371.1Sthorpej    __data_start = . ;
381.1Sthorpej    *(.data)
391.1Sthorpej    *(.data.*)
401.1Sthorpej  } > sdram
411.1Sthorpej  .sdata     : 
421.1Sthorpej  AT (LOADADDR(.data) + SIZEOF(.data))
431.1Sthorpej  {
441.1Sthorpej    *(.sdata) 
451.1Sthorpej    *(.sdata.*)
461.3Sjoff    . = ALIGN(32 / 8);
471.1Sthorpej  } > sdram
481.1Sthorpej  _edata = .;
491.1Sthorpej  PROVIDE (edata = .);
501.1Sthorpej  __bss_start = .;
511.1Sthorpej  __bss_start__ = .;
521.1Sthorpej  .sbss      :
531.5Sskrll  AT (ADDR(.sbss))
541.1Sthorpej  {
551.1Sthorpej    PROVIDE (__sbss_start = .);
561.1Sthorpej    PROVIDE (___sbss_start = .);
571.1Sthorpej    *(.dynsbss)
581.1Sthorpej    *(.sbss)
591.1Sthorpej    *(.sbss.*)
601.1Sthorpej    *(.scommon)
611.1Sthorpej    PROVIDE (__sbss_end = .);
621.1Sthorpej    PROVIDE (___sbss_end = .);
631.1Sthorpej  } > sdram
641.1Sthorpej  .bss       :
651.5Sskrll  AT (ADDR(.bss))
661.1Sthorpej  {
671.1Sthorpej   *(.dynbss)
681.1Sthorpej   *(.bss)
691.1Sthorpej   *(.bss.*)
701.1Sthorpej   *(COMMON)
711.1Sthorpej   /* Align here to ensure that the .bss section occupies space up to
721.1Sthorpej      _end.  Align after .bss to ensure correct alignment even if the
731.1Sthorpej      .bss section disappears because there are no input sections.  */
741.1Sthorpej   . = ALIGN(32 / 8);
751.1Sthorpej  } > sdram
761.1Sthorpej  . = ALIGN(32 / 8);
771.1Sthorpej  _end = .;
781.1Sthorpej  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
791.1Sthorpej  PROVIDE (end = .);
801.1Sthorpej  .image   (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) :
811.1Sthorpej  AT (LOADADDR(.sdata) + SIZEOF(.sdata))
821.1Sthorpej  {
831.1Sthorpej    *(.image)
841.1Sthorpej  }
851.1Sthorpej}
86