1 | /* |
---|
2 | * This file contains directives for the GNU linker which are specific |
---|
3 | * to the Freescale ColdFire mcf52235 |
---|
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.org/license/LICENSE.e |
---|
11 | */ |
---|
12 | |
---|
13 | /* |
---|
14 | * Declare some sizes. |
---|
15 | */ |
---|
16 | RamBase = DEFINED(RamBase) ? RamBase : 0x20000000; |
---|
17 | RamSize = DEFINED(RamSize) ? RamSize : 32K; |
---|
18 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
19 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x400; |
---|
20 | _FlashBase = DEFINED(_FlashBase) ? _FlashBase : 0x00000000; |
---|
21 | |
---|
22 | _VBR = 0x20000000; |
---|
23 | |
---|
24 | ENTRY(start) |
---|
25 | STARTUP(start.o) |
---|
26 | |
---|
27 | MEMORY |
---|
28 | { |
---|
29 | sram : ORIGIN = 0x20000000, LENGTH = 32K |
---|
30 | flash : ORIGIN = 0x00000000, LENGTH = 256K |
---|
31 | } |
---|
32 | |
---|
33 | SECTIONS |
---|
34 | { |
---|
35 | /* |
---|
36 | * Text, data and bss segments |
---|
37 | */ |
---|
38 | .text : { |
---|
39 | |
---|
40 | *(.text*) |
---|
41 | *(.ram_code) |
---|
42 | |
---|
43 | /* |
---|
44 | * C++ constructors/destructors |
---|
45 | */ |
---|
46 | *(.gnu.linkonce.t.*) |
---|
47 | |
---|
48 | /* |
---|
49 | * Initialization and finalization code. |
---|
50 | * |
---|
51 | * Various files can provide initialization and finalization |
---|
52 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
53 | * body of these functions are in .init and .fini sections. We |
---|
54 | * accumulate the bodies here, and prepend function prologues |
---|
55 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
56 | * be linked first; crtn.o must be linked last. Because these |
---|
57 | * are wildcards, it doesn't matter if the user does not |
---|
58 | * actually link against crti.o and crtn.o; the linker won't |
---|
59 | * look for a file to match a wildcard. The wildcard also |
---|
60 | * means that it doesn't matter which directory crti.o and |
---|
61 | * crtn.o are in. |
---|
62 | */ |
---|
63 | PROVIDE (_init = .); |
---|
64 | *crti.o(.init) |
---|
65 | *(.init) |
---|
66 | *crtn.o(.init) |
---|
67 | PROVIDE (_fini = .); |
---|
68 | *crti.o(.fini) |
---|
69 | *(.fini) |
---|
70 | *crtn.o(.fini) |
---|
71 | |
---|
72 | /* |
---|
73 | * Special FreeBSD sysctl sections. |
---|
74 | */ |
---|
75 | . = ALIGN (16); |
---|
76 | __start_set_sysctl_set = .; |
---|
77 | *(set_sysctl_*); |
---|
78 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
79 | *(set_domain_*); |
---|
80 | *(set_pseudo_*); |
---|
81 | |
---|
82 | /* |
---|
83 | * C++ constructors/destructors |
---|
84 | * |
---|
85 | * gcc uses crtbegin.o to find the start of the constructors |
---|
86 | * and destructors so we make sure it is first. Because this |
---|
87 | * is a wildcard, it doesn't matter if the user does not |
---|
88 | * actually link against crtbegin.o; the linker won't look for |
---|
89 | * a file to match a wildcard. The wildcard also means that |
---|
90 | * it doesn't matter which directory crtbegin.o is in. The |
---|
91 | * constructor and destructor list are terminated in |
---|
92 | * crtend.o. The same comments apply to it. |
---|
93 | */ |
---|
94 | . = ALIGN (16); |
---|
95 | *crtbegin.o(.ctors) |
---|
96 | *(.ctors) |
---|
97 | *crtend.o(.ctors) |
---|
98 | *crtbegin.o(.dtors) |
---|
99 | *(.dtors) |
---|
100 | *crtend.o(.dtors) |
---|
101 | |
---|
102 | /* |
---|
103 | * Exception frame info |
---|
104 | */ |
---|
105 | . = ALIGN (16); |
---|
106 | *(.eh_frame) |
---|
107 | |
---|
108 | /* |
---|
109 | * Read-only data |
---|
110 | */ |
---|
111 | . = ALIGN (16); |
---|
112 | _rodata_start = . ; |
---|
113 | *(.rodata*) |
---|
114 | KEEP (*(SORT(.rtemsroset.*))) |
---|
115 | *(.gnu.linkonce.r*) |
---|
116 | |
---|
117 | . = ALIGN (16); |
---|
118 | |
---|
119 | *(.console_gdb_xfer) |
---|
120 | *(.bootstrap_data) |
---|
121 | } >flash |
---|
122 | |
---|
123 | .tdata : { |
---|
124 | _TLS_Data_begin = .; |
---|
125 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
126 | _TLS_Data_end = .; |
---|
127 | . = ALIGN(16); |
---|
128 | _estuff = .; |
---|
129 | PROVIDE (_etext = .); |
---|
130 | } >flash |
---|
131 | |
---|
132 | .tbss : { |
---|
133 | _TLS_BSS_begin = .; |
---|
134 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
135 | _TLS_BSS_end = .; |
---|
136 | } >flash |
---|
137 | |
---|
138 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
139 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
140 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
141 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
142 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
143 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
144 | |
---|
145 | .data 0x20000400 : AT (_estuff) |
---|
146 | { |
---|
147 | PROVIDE( _data_dest_start = . ); |
---|
148 | PROVIDE( _copy_start = .); |
---|
149 | *(.data) |
---|
150 | *(.data.*) |
---|
151 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
152 | *(.gnu.linkonce.d*) |
---|
153 | *(.gcc_except_table*) |
---|
154 | *(.jcr) |
---|
155 | . = ALIGN (16); |
---|
156 | PROVIDE (_edata = .); |
---|
157 | PROVIDE (_copy_end = .); |
---|
158 | PROVIDE (_data_dest_end = . ); |
---|
159 | } >sram |
---|
160 | |
---|
161 | _data_src_start = _estuff; |
---|
162 | _data_src_end = _data_dest_start + SIZEOF(.data); |
---|
163 | |
---|
164 | .bss : |
---|
165 | { |
---|
166 | PROVIDE (_clear_start = .); |
---|
167 | *(.bss*) |
---|
168 | *(COMMON) |
---|
169 | . = ALIGN (16); |
---|
170 | PROVIDE (_end = .); |
---|
171 | PROVIDE (_clear_end = .); |
---|
172 | } >sram |
---|
173 | |
---|
174 | .stack : |
---|
175 | { |
---|
176 | /* |
---|
177 | * Starting Stack |
---|
178 | */ |
---|
179 | . += _StackSize; |
---|
180 | . = ALIGN (16); |
---|
181 | PROVIDE(_StackInit = .); |
---|
182 | PROVIDE(WorkAreaBase = .); |
---|
183 | } >sram |
---|
184 | |
---|
185 | /* Stabs debugging sections. */ |
---|
186 | .stab 0 : { *(.stab) } |
---|
187 | .stabstr 0 : { *(.stabstr) } |
---|
188 | .stab.excl 0 : { *(.stab.excl) } |
---|
189 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
190 | .stab.index 0 : { *(.stab.index) } |
---|
191 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
192 | .comment 0 : { *(.comment) } |
---|
193 | |
---|
194 | PROVIDE (end_of_all = .); |
---|
195 | } |
---|