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