ldscript revision 1.1
1/*	$NetBSD: ldscript,v 1.1 2003/07/30 18:54:18 bsh Exp $	*/
2
3OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm",
4	      "elf32-littlearm")
5OUTPUT_ARCH(arm)
6ENTRY(FLASH)
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  flash : o = 0x00100000, l = 16M - 1M
13  sdram : o = 0x08000000, l = 1M	/* kernel loads at 0x08200000 */
14}
15SECTIONS
16{
17  FLASH = 0x100000;
18
19  /* Read-only sections, merged into text segment: */
20  __text_store = FLASH;
21  .text      :
22  AT (FLASH)
23  {
24    *(.text)
25    *(.text.*)
26    *(.stub)
27    *(.glue_7t) *(.glue_7)
28    *(.rodata) *(.rodata.*)
29  } > sdram =0
30  PROVIDE (__etext = .);
31  PROVIDE (_etext = .);
32  PROVIDE (etext = .);
33  __data_store = FLASH + SIZEOF(.text);
34  .data    :
35  AT (LOADADDR(.text) + SIZEOF(.text))
36  {
37    __data_start = . ;
38    *(.data)
39    *(.data.*)
40  } > sdram
41  .sdata     : 
42  AT (LOADADDR(.data) + SIZEOF(.data))
43  {
44    *(.sdata) 
45    *(.sdata.*)
46  } > sdram
47  _edata = .;
48  PROVIDE (edata = .);
49  __bss_start = .;
50  __bss_start__ = .;
51  .sbss      :
52  {
53    PROVIDE (__sbss_start = .);
54    PROVIDE (___sbss_start = .);
55    *(.dynsbss)
56    *(.sbss)
57    *(.sbss.*)
58    *(.scommon)
59    PROVIDE (__sbss_end = .);
60    PROVIDE (___sbss_end = .);
61  } > sdram
62  .bss       :
63  {
64   *(.dynbss)
65   *(.bss)
66   *(.bss.*)
67   *(COMMON)
68   /* Align here to ensure that the .bss section occupies space up to
69      _end.  Align after .bss to ensure correct alignment even if the
70      .bss section disappears because there are no input sections.  */
71   . = ALIGN(32 / 8);
72  } > sdram
73  . = ALIGN(32 / 8);
74  _end = .;
75  _bss_end__ = . ; __bss_end__ = . ; __end__ = . ;
76  PROVIDE (end = .);
77  .image   (FLASH + SIZEOF(.text) + SIZEOF(.data) + SIZEOF(.sdata)) :
78  AT (LOADADDR(.sdata) + SIZEOF(.sdata))
79  {
80    *(.image)
81  }
82}
83