11.2Sthorpej/*	$NetBSD: ldscript,v 1.2 2020/02/12 18:11:30 thorpej Exp $	*/
21.1Sthorpej
31.1SthorpejOUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm",
41.1Sthorpej	      "elf32-littlearm")
51.1SthorpejOUTPUT_ARCH(arm)
61.1SthorpejENTRY(SDRAM)
71.1SthorpejMEMORY
81.1Sthorpej{
91.1Sthorpej  /* RedBoot will copy the gzboot+compressed kernel image from the
101.1Sthorpej     FIS partition starting @ 0x50060000 to the SDRAM location starting
111.1Sthorpej     at 0x01d00000.  gzboot will uncompress the kernel to 0x00200000.
121.1Sthorpej     NOTE: Even though there is room for 3M of gzboot+compressed kernel,
131.1Sthorpej     there is only room for 1M of this in the FIS partition.  So we declare
141.1Sthorpej     that same limit for "sdram" to simplify the linker script.  */
151.1Sthorpej  flash : o = 0x50060000, l = 1M
161.1Sthorpej  sdram : o = 0x01d00000, l = 1M	/* kernel loads at 0x00200000 */
171.1Sthorpej}
181.1SthorpejSECTIONS
191.1Sthorpej{
201.1Sthorpej  SDRAM = 0x01d00000;
211.1Sthorpej
221.1Sthorpej  /DISCARD/ : { *(.ARM.attributes*) *(.ARM.exidx) }  
231.1Sthorpej
241.1Sthorpej  /* Read-only sections, merged into text segment: */
251.1Sthorpej  __text_store = SDRAM;
261.1Sthorpej  .text      :
271.1Sthorpej  AT (SDRAM)
281.1Sthorpej  {
291.1Sthorpej    *(.text)
301.1Sthorpej    *(.text.*)
311.1Sthorpej    *(.stub)
321.1Sthorpej    *(.glue_7t) *(.glue_7)
331.1Sthorpej    *(.rodata) *(.rodata.*)
341.1Sthorpej  } > sdram =0
351.1Sthorpej  PROVIDE (__etext = .);
361.1Sthorpej  PROVIDE (_etext = .);
371.1Sthorpej  PROVIDE (etext = .);
381.1Sthorpej  __data_store = SDRAM + SIZEOF(.text);
391.1Sthorpej  .data    :
401.1Sthorpej  AT (LOADADDR(.text) + SIZEOF(.text))
411.1Sthorpej  {
421.1Sthorpej    __data_start = . ;
431.1Sthorpej    *(.data)
441.1Sthorpej    *(.data.*)
451.1Sthorpej  } > sdram
461.1Sthorpej  .sdata     : 
471.1Sthorpej  AT (LOADADDR(.data) + SIZEOF(.data))
481.1Sthorpej  {
491.1Sthorpej    *(.sdata) 
501.1Sthorpej    *(.sdata.*)
511.1Sthorpej    . = ALIGN(32 / 8);
521.1Sthorpej  } > sdram
531.1Sthorpej  _edata = .;
541.1Sthorpej  PROVIDE (edata = .);
551.1Sthorpej  __bss_start = .;
561.1Sthorpej  __bss_start__ = .;
571.1Sthorpej  .sbss      :
581.2Sthorpej  AT (LOADADDR(.sdata) + SIZEOF(.sdata))
591.1Sthorpej  {
601.1Sthorpej    PROVIDE (__sbss_start = .);
611.1Sthorpej    PROVIDE (___sbss_start = .);
621.1Sthorpej    *(.dynsbss)
631.1Sthorpej    *(.sbss)
641.1Sthorpej    *(.sbss.*)
651.1Sthorpej    *(.scommon)
661.1Sthorpej    PROVIDE (__sbss_end = .);
671.1Sthorpej    PROVIDE (___sbss_end = .);
681.1Sthorpej  } > sdram
691.1Sthorpej  .bss       :
701.2Sthorpej  AT (LOADADDR(.sbss) + SIZEOF(.sbss))
711.1Sthorpej  {
721.1Sthorpej   *(.dynbss)
731.1Sthorpej   *(.bss)
741.1Sthorpej   *(.bss.*)
751.1Sthorpej   *(COMMON)
761.1Sthorpej   /* Align here to ensure that the .bss section occupies space up to
771.1Sthorpej      _end.  Align after .bss to ensure correct alignment even if the
781.1Sthorpej      .bss section disappears because there are no input sections.  */
791.1Sthorpej   . = ALIGN(32 / 8);
801.1Sthorpej  } > sdram
811.1Sthorpej  . = ALIGN(32 / 8);
821.1Sthorpej  _end = .;
831.1Sthorpej  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
841.1Sthorpej  PROVIDE (end = .);
851.2Sthorpej  .image     :
861.2Sthorpej  AT (LOADADDR(.bss) + SIZEOF(.bss))
871.1Sthorpej  {
881.1Sthorpej    *(.image)
891.2Sthorpej  } > sdram
901.1Sthorpej}
91