1164640Sflz/*	$NetBSD: ldscript,v 1.2 2020/02/12 18:11:30 thorpej Exp $	*/
298186Sgordon
378344SobrienOUTPUT_FORMAT("elf32-bigarm", "elf32-bigarm",
4157473Sflz	      "elf32-littlearm")
578344SobrienOUTPUT_ARCH(arm)
678344SobrienENTRY(SDRAM)
778344SobrienMEMORY
878344Sobrien{
978344Sobrien  /* RedBoot will copy the gzboot+compressed kernel image from the
1078344Sobrien     FIS partition starting @ 0x50060000 to the SDRAM location starting
1178344Sobrien     at 0x01d00000.  gzboot will uncompress the kernel to 0x00200000.
1278344Sobrien     NOTE: Even though there is room for 3M of gzboot+compressed kernel,
1378344Sobrien     there is only room for 1M of this in the FIS partition.  So we declare
1478344Sobrien     that same limit for "sdram" to simplify the linker script.  */
1578344Sobrien  flash : o = 0x50060000, l = 1M
1678344Sobrien  sdram : o = 0x01d00000, l = 1M	/* kernel loads at 0x00200000 */
1778344Sobrien}
1878344SobrienSECTIONS
1978344Sobrien{
2078344Sobrien  SDRAM = 0x01d00000;
2178344Sobrien
2278344Sobrien  /DISCARD/ : { *(.ARM.attributes*) *(.ARM.exidx) }  
2378344Sobrien
2478344Sobrien  /* Read-only sections, merged into text segment: */
2578344Sobrien  __text_store = SDRAM;
2678344Sobrien  .text      :
2778344Sobrien  AT (SDRAM)
2878344Sobrien  {
2978344Sobrien    *(.text)
3078344Sobrien    *(.text.*)
3178344Sobrien    *(.stub)
3278344Sobrien    *(.glue_7t) *(.glue_7)
3378344Sobrien    *(.rodata) *(.rodata.*)
3478344Sobrien  } > sdram =0
35169668Smtm  PROVIDE (__etext = .);
36157473Sflz  PROVIDE (_etext = .);
3778344Sobrien  PROVIDE (etext = .);
3898186Sgordon  __data_store = SDRAM + SIZEOF(.text);
3998186Sgordon  .data    :
4098186Sgordon  AT (LOADADDR(.text) + SIZEOF(.text))
41131550Scperciva  {
42131550Scperciva    __data_start = . ;
43131550Scperciva    *(.data)
44131550Scperciva    *(.data.*)
4598186Sgordon  } > sdram
4698186Sgordon  .sdata     : 
47202988Semaste  AT (LOADADDR(.data) + SIZEOF(.data))
48124832Smtm  {
49124832Smtm    *(.sdata) 
50161435Syar    *(.sdata.*)
51161435Syar    . = ALIGN(32 / 8);
5298186Sgordon  } > sdram
5398186Sgordon  _edata = .;
5478344Sobrien  PROVIDE (edata = .);
5578344Sobrien  __bss_start = .;
5678344Sobrien  __bss_start__ = .;
57197144Shrs  .sbss      :
58197144Shrs  AT (LOADADDR(.sdata) + SIZEOF(.sdata))
59197144Shrs  {
6098186Sgordon    PROVIDE (__sbss_start = .);
61197144Shrs    PROVIDE (___sbss_start = .);
62197144Shrs    *(.dynsbss)
63197144Shrs    *(.sbss)
64197144Shrs    *(.sbss.*)
65197144Shrs    *(.scommon)
66197144Shrs    PROVIDE (__sbss_end = .);
67197144Shrs    PROVIDE (___sbss_end = .);
68197144Shrs  } > sdram
69197144Shrs  .bss       :
70197144Shrs  AT (LOADADDR(.sbss) + SIZEOF(.sbss))
71197144Shrs  {
72197144Shrs   *(.dynbss)
73197144Shrs   *(.bss)
7498186Sgordon   *(.bss.*)
7598186Sgordon   *(COMMON)
7698186Sgordon   /* Align here to ensure that the .bss section occupies space up to
7798186Sgordon      _end.  Align after .bss to ensure correct alignment even if the
7898186Sgordon      .bss section disappears because there are no input sections.  */
7998186Sgordon   . = ALIGN(32 / 8);
8098186Sgordon  } > sdram
8198186Sgordon  . = ALIGN(32 / 8);
8298186Sgordon  _end = .;
8398186Sgordon  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
8498186Sgordon  PROVIDE (end = .);
85146490Sschweikh  .image     :
8698186Sgordon  AT (LOADADDR(.bss) + SIZEOF(.bss))
8798186Sgordon  {
8898186Sgordon    *(.image)
8998186Sgordon  } > sdram
9098186Sgordon}
9198186Sgordon