1 | /* |
---|
2 | * This file contains directives for the GNU linker which are specific |
---|
3 | * to the Freescale ColdFire mcf5235 |
---|
4 | * |
---|
5 | * COPYRIGHT (c) 1989-1999. |
---|
6 | * On-Line Applications Research Corporation (OAR). |
---|
7 | * |
---|
8 | * The license and distribution terms for this file may be |
---|
9 | * found in the file LICENSE in this distribution or at |
---|
10 | * http://www.rtems.com/license/LICENSE. |
---|
11 | * |
---|
12 | * $Id$ |
---|
13 | */ |
---|
14 | |
---|
15 | /* |
---|
16 | * declare for the MCF5235_BSP_START_FROM_FLASH |
---|
17 | * 0 - use debug monitor to load to ram |
---|
18 | * 1 - load everything from flash from scratch |
---|
19 | */ |
---|
20 | MCF5235_BSP_START_FROM_FLASH = 0; |
---|
21 | |
---|
22 | /* |
---|
23 | * Declare some sizes. |
---|
24 | */ |
---|
25 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x0 ; |
---|
26 | _RamSize = DEFINED(_RamSize) ? _RamSize : 16M ; |
---|
27 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0 ; |
---|
28 | |
---|
29 | |
---|
30 | /* |
---|
31 | * System clock speed |
---|
32 | */ |
---|
33 | _CPUClockSpeed = DEFINED(_CPUClockSpeed) ? _CPUClockSpeed : 150000000 ; |
---|
34 | |
---|
35 | /* |
---|
36 | * Location of on-chip devices |
---|
37 | */ |
---|
38 | __IPSBAR = DEFINED(__IPSBAR) ? __IPSBAR : 0x40000000 ; |
---|
39 | __SRAMBASE = DEFINED(__SRAMBASE) ? __SRAMBASE : 0x20000000 ; |
---|
40 | _VBR = 0x0; |
---|
41 | |
---|
42 | ENTRY(start) |
---|
43 | MEMORY |
---|
44 | { |
---|
45 | ram : ORIGIN = 0, LENGTH = 16M |
---|
46 | sram : ORIGIN = 0x20000000, LENGTH = 64K |
---|
47 | flash : ORIGIN = 0xFFE00000, LENGTH = 2M |
---|
48 | } |
---|
49 | |
---|
50 | SECTIONS |
---|
51 | { |
---|
52 | |
---|
53 | _header_offset = 0; |
---|
54 | |
---|
55 | /* |
---|
56 | * Text, data and bss segments |
---|
57 | */ |
---|
58 | .text 0x40000 : { |
---|
59 | |
---|
60 | *(.text*) |
---|
61 | *(.ram_code) |
---|
62 | |
---|
63 | /* |
---|
64 | * C++ constructors/destructors |
---|
65 | */ |
---|
66 | *(.gnu.linkonce.t.*) |
---|
67 | |
---|
68 | /* |
---|
69 | * Initialization and finalization code. |
---|
70 | * |
---|
71 | * Various files can provide initialization and finalization |
---|
72 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
73 | * body of these functions are in .init and .fini sections. We |
---|
74 | * accumulate the bodies here, and prepend function prologues |
---|
75 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
76 | * be linked first; crtn.o must be linked last. Because these |
---|
77 | * are wildcards, it doesn't matter if the user does not |
---|
78 | * actually link against crti.o and crtn.o; the linker won't |
---|
79 | * look for a file to match a wildcard. The wildcard also |
---|
80 | * means that it doesn't matter which directory crti.o and |
---|
81 | * crtn.o are in. |
---|
82 | */ |
---|
83 | PROVIDE (_init = .); |
---|
84 | *crti.o(.init) |
---|
85 | *(.init) |
---|
86 | *crtn.o(.init) |
---|
87 | PROVIDE (_fini = .); |
---|
88 | *crti.o(.fini) |
---|
89 | *(.fini) |
---|
90 | *crtn.o(.fini) |
---|
91 | |
---|
92 | /* |
---|
93 | * Special FreeBSD sysctl sections. |
---|
94 | */ |
---|
95 | . = ALIGN (16); |
---|
96 | __start_set_sysctl_set = .; |
---|
97 | *(set_sysctl_*); |
---|
98 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
99 | *(set_domain_*); |
---|
100 | *(set_pseudo_*); |
---|
101 | |
---|
102 | |
---|
103 | /* |
---|
104 | * C++ constructors/destructors |
---|
105 | * |
---|
106 | * gcc uses crtbegin.o to find the start of the constructors |
---|
107 | * and destructors so we make sure it is first. Because this |
---|
108 | * is a wildcard, it doesn't matter if the user does not |
---|
109 | * actually link against crtbegin.o; the linker won't look for |
---|
110 | * a file to match a wildcard. The wildcard also means that |
---|
111 | * it doesn't matter which directory crtbegin.o is in. The |
---|
112 | * constructor and destructor list are terminated in |
---|
113 | * crtend.o. The same comments apply to it. |
---|
114 | */ |
---|
115 | . = ALIGN (16); |
---|
116 | *crtbegin.o(.ctors) |
---|
117 | *(.ctors) |
---|
118 | *crtend.o(.ctors) |
---|
119 | *crtbegin.o(.dtors) |
---|
120 | *(.dtors) |
---|
121 | *crtend.o(.dtors) |
---|
122 | |
---|
123 | /* |
---|
124 | * Exception frame info |
---|
125 | */ |
---|
126 | . = ALIGN (16); |
---|
127 | *(.eh_frame) |
---|
128 | |
---|
129 | /* |
---|
130 | * Read-only data |
---|
131 | */ |
---|
132 | . = ALIGN (16); |
---|
133 | _rodata_start = . ; |
---|
134 | *(.rodata*) |
---|
135 | *(.gnu.linkonce.r*) |
---|
136 | |
---|
137 | . = ALIGN (16); |
---|
138 | |
---|
139 | *(.console_gdb_xfer) |
---|
140 | *(.bootstrap_data) |
---|
141 | . = ALIGN(16); |
---|
142 | _estuff = .; |
---|
143 | PROVIDE (_etext = .); |
---|
144 | } >ram |
---|
145 | |
---|
146 | .data : { |
---|
147 | PROVIDE( _data_dest_start = . ); |
---|
148 | PROVIDE( _copy_start = .); |
---|
149 | *(.data) |
---|
150 | *(.gnu.linkonce.d*) |
---|
151 | *(.gcc_except_table*) |
---|
152 | *(.jcr) |
---|
153 | . = ALIGN (16); |
---|
154 | PROVIDE (_edata = .); |
---|
155 | PROVIDE (_copy_end = .); |
---|
156 | PROVIDE (_data_dest_end = . ); |
---|
157 | } >ram |
---|
158 | |
---|
159 | _data_src_start = _estuff; |
---|
160 | _data_src_end = _data_dest_start + SIZEOF(.data); |
---|
161 | |
---|
162 | .bss : { |
---|
163 | _clear_start = .; |
---|
164 | *(.bss*) |
---|
165 | *(COMMON) |
---|
166 | . = ALIGN (16); |
---|
167 | PROVIDE (end = .); |
---|
168 | _clear_end = .; |
---|
169 | |
---|
170 | _WorkspaceBase = .; |
---|
171 | } >ram |
---|
172 | /* Stabs debugging sections. */ |
---|
173 | .stab 0 : { *(.stab) } |
---|
174 | .stabstr 0 : { *(.stabstr) } |
---|
175 | .stab.excl 0 : { *(.stab.excl) } |
---|
176 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
177 | .stab.index 0 : { *(.stab.index) } |
---|
178 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
179 | .comment 0 : { *(.comment) } |
---|
180 | |
---|
181 | PROVIDE (end_of_all = .); |
---|
182 | } |
---|