OSDN Git Service

マルチプロジェクト型にレポジトリを変更するために移動した
[toppersasp4lpc/asp.git] / asp / target / lpc1768_generic_gcc / lpc1768_rom.ld
1 /*
2 * LPC1768のFlash ROM上でプログラムを動かすための最低限度のLDファイル。
3 * 変数をSRAM上に配置する。Sourcery G++ 2010q1-188の
4 * Generic-m-hosted.ldを修正して使用。
5 */
6
7 OUTPUT_FORMAT ("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
8 ENTRY(_start)
9 SEARCH_DIR(.)
10
11 MEMORY
12 {
13   rom_vector (rwx) : ORIGIN = 0x00000000, LENGTH = 256
14   rom (rwx)        : ORIGIN = 0x00000100, LENGTH = 511K
15   ram(rx)          : ORIGIN = 0x10000000, LENGTH = 32K
16 }
17
18
19 PROVIDE(hardware_init_hook = 0);
20 PROVIDE(software_init_hook = 0);
21 PROVIDE(software_term_hook = 0);
22 STARTUP(start.o)
23
24 SECTIONS
25 {
26
27    _vector_start_lma = ALIGN(8);
28
29   .vector :
30   {
31         *(.vector)
32   } > rom_vector
33   
34
35   .text :
36   {
37     *(.text .text.* .gnu.linkonce.t.*)
38     *(.plt)
39     *(.gnu.warning)
40     *(.glue_7t) *(.glue_7) *(.vfp11_veneer)
41
42     *(.ARM.extab* .gnu.linkonce.armextab.*)
43     *(.gcc_except_table)
44   } >rom
45
46   .eh_frame_hdr : ALIGN (4)
47   {
48     KEEP (*(.eh_frame_hdr))
49   } >rom
50   
51   /* .ARM.exidx is sorted, so has to go in its own output section.  */
52   PROVIDE_HIDDEN (__exidx_start = .);
53   .ARM.exidx :
54   {
55     *(.ARM.exidx* .gnu.linkonce.armexidx.*)
56   } >rom
57
58   PROVIDE_HIDDEN (__exidx_end = .);
59
60   .rodata : ALIGN (4)
61   {
62     *(.rodata .rodata.* .gnu.linkonce.r.*)
63
64     . = ALIGN(4);
65     KEEP(*(.init))
66
67     . = ALIGN(4);
68     __preinit_array_start = .;
69     KEEP (*(.preinit_array))
70     __preinit_array_end = .;
71
72     . = ALIGN(4);
73     __init_array_start = .;
74     KEEP (*(SORT(.init_array.*)))
75     KEEP (*(.init_array))
76     __init_array_end = .;
77
78     . = ALIGN(4);
79     KEEP(*(.fini))
80
81     . = ALIGN(4);
82     __fini_array_start = .;
83     KEEP (*(.fini_array))
84     KEEP (*(SORT(.fini_array.*)))
85     __fini_array_end = .;
86
87     . = ALIGN(0x4);
88     KEEP (*crtbegin.o(.ctors))
89     KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors))
90     KEEP (*(SORT(.ctors.*)))
91     KEEP (*crtend.o(.ctors))
92
93     . = ALIGN(0x4);
94     KEEP (*crtbegin.o(.dtors))
95     KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors))
96     KEEP (*(SORT(.dtors.*)))
97     KEEP (*crtend.o(.dtors))
98
99     . = ALIGN (8);
100     _etext = .;
101   } >rom
102   
103    __idata_start = ALIGN(8);
104   .data : AT (__idata_start )
105   {
106     . = ALIGN(8);
107     __data_start = .;
108     KEEP(*(.jcr))
109     *(.got.plt) *(.got)
110     *(.shdata)
111     *(.data .data.* .gnu.linkonce.d.*)
112     . = ALIGN (8);
113     *(.ram)
114     KEEP (*(.eh_frame))
115     . = ALIGN(8);
116     _edata = .;
117   } >ram
118   __idata_end = __idata_start + SIZEOF(.data);
119     
120   .bss : ALIGN(8)
121   {
122     __bss_start = .;
123     *(.shbss)
124     *(.bss .bss.* .gnu.linkonce.b.*)
125     *(COMMON)
126     . = ALIGN (8);
127     *(.ram.b .bss.ram)
128     _end = .;
129     __end = .;
130     __bss_end = .;
131   } >ram
132
133   .stab 0 (NOLOAD) : { *(.stab) }
134   .stabstr 0 (NOLOAD) : { *(.stabstr) }
135   /* DWARF debug sections.
136    * Symbols in the DWARF debugging sections are relative to
137    * the beginning of the section so we begin them at 0.
138    */
139   /* DWARF 1 */
140   .debug          0 : { *(.debug) }
141   .line           0 : { *(.line) }
142   /* GNU DWARF 1 extensions */
143   .debug_srcinfo  0 : { *(.debug_srcinfo) }
144   .debug_sfnames  0 : { *(.debug_sfnames) }
145   /* DWARF 1.1 and DWARF 2 */
146   .debug_aranges  0 : { *(.debug_aranges) }
147   .debug_pubnames 0 : { *(.debug_pubnames) }
148   /* DWARF 2 */
149   .debug_info     0 : { *(.debug_info .gnu.linkonce.wi.*) }
150   .debug_abbrev   0 : { *(.debug_abbrev) }
151   .debug_line     0 : { *(.debug_line) }
152   .debug_frame    0 : { *(.debug_frame) }
153   .debug_str      0 : { *(.debug_str) }
154   .debug_loc      0 : { *(.debug_loc) }
155   .debug_macinfo  0 : { *(.debug_macinfo) }
156   /* DWARF 2.1 */
157   .debug_ranges   0 : { *(.debug_ranges) }
158   /* SGI/MIPS DWARF 2 extensions */
159   .debug_weaknames 0 : { *(.debug_weaknames) }
160   .debug_funcnames 0 : { *(.debug_funcnames) }
161   .debug_typenames 0 : { *(.debug_typenames) }
162   .debug_varnames  0 : { *(.debug_varnames) }
163
164   .note.gnu.arm.ident 0 : { KEEP (*(.note.gnu.arm.ident)) }
165   .ARM.attributes 0 : { KEEP (*(.ARM.attributes)) }
166   /DISCARD/ : { *(.note.GNU-stack) }
167 }