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