1 | /* |
---|
2 | * This file contains GNU linker directives for a generic MC68360 board. |
---|
3 | * Variations in memory size and allocation can be made by |
---|
4 | * overriding some values with linker command-line arguments. |
---|
5 | * |
---|
6 | * Saskatchewan Accelerator Laboratory |
---|
7 | * University of Saskatchewan |
---|
8 | * Saskatoon, Saskatchewan, CANADA |
---|
9 | * eric@skatter.usask.ca |
---|
10 | */ |
---|
11 | |
---|
12 | /* |
---|
13 | * Declare some sizes. |
---|
14 | * A heap size of 0 means `use all available memory for the heap'. |
---|
15 | */ |
---|
16 | RamBase = DEFINED(RamBase) ? RamBase : 0x0; |
---|
17 | RamSize = DEFINED(RamSize) ? RamSize : 64M; |
---|
18 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
19 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
20 | |
---|
21 | /* |
---|
22 | * Declare on-board memory. |
---|
23 | */ |
---|
24 | MEMORY { |
---|
25 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
26 | rom : ORIGIN = 0x0F000000, LENGTH = 1M |
---|
27 | dpram : ORIGIN = 0x0E000000, LENGTH = 8k |
---|
28 | } |
---|
29 | |
---|
30 | ENTRY(start) |
---|
31 | STARTUP(start.o) |
---|
32 | |
---|
33 | /* |
---|
34 | * Load objects |
---|
35 | */ |
---|
36 | SECTIONS { |
---|
37 | /* |
---|
38 | * Boot PROM |
---|
39 | */ |
---|
40 | rom : { |
---|
41 | _RomBase = .; |
---|
42 | } >rom |
---|
43 | |
---|
44 | /* |
---|
45 | * Dynamic RAM |
---|
46 | */ |
---|
47 | ram : { |
---|
48 | RamBase = .; |
---|
49 | } >ram |
---|
50 | |
---|
51 | /* |
---|
52 | * Text, data and bss segments |
---|
53 | */ |
---|
54 | .text : { |
---|
55 | *(.text*) |
---|
56 | |
---|
57 | /* |
---|
58 | * C++ constructors/destructors |
---|
59 | */ |
---|
60 | *(.gnu.linkonce.t.*) |
---|
61 | |
---|
62 | /* |
---|
63 | * Initialization and finalization code. |
---|
64 | */ |
---|
65 | PROVIDE (_init = .); |
---|
66 | *crti.o(.init) |
---|
67 | *(.init) |
---|
68 | *crtn.o(.init) |
---|
69 | PROVIDE (_fini = .); |
---|
70 | *crti.o(.fini) |
---|
71 | *(.fini) |
---|
72 | *crtn.o(.fini) |
---|
73 | |
---|
74 | /* |
---|
75 | * Special FreeBSD sysctl sections. |
---|
76 | */ |
---|
77 | . = ALIGN (16); |
---|
78 | __start_set_sysctl_set = .; |
---|
79 | *(set_sysctl_*); |
---|
80 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
81 | *(set_domain_*); |
---|
82 | *(set_pseudo_*); |
---|
83 | |
---|
84 | /* |
---|
85 | * C++ constructors/destructors |
---|
86 | */ |
---|
87 | . = ALIGN (16); |
---|
88 | *crtbegin.o(.ctors) |
---|
89 | *(.ctors) |
---|
90 | *crtend.o(.ctors) |
---|
91 | *crtbegin.o(.dtors) |
---|
92 | *(.dtors) |
---|
93 | *crtend.o(.dtors) |
---|
94 | |
---|
95 | /* |
---|
96 | * Exception frame info |
---|
97 | */ |
---|
98 | . = ALIGN (16); |
---|
99 | *(.eh_frame) |
---|
100 | |
---|
101 | /* |
---|
102 | * Read-only data |
---|
103 | */ |
---|
104 | . = ALIGN (16); |
---|
105 | _rodata_start = . ; |
---|
106 | *(.rodata*) |
---|
107 | KEEP (*(SORT(.rtemsroset.*))) |
---|
108 | *(.gnu.linkonce.r*) |
---|
109 | |
---|
110 | . = ALIGN (16); |
---|
111 | PROVIDE (etext = .); |
---|
112 | } >ram |
---|
113 | |
---|
114 | .tdata : { |
---|
115 | _TLS_Data_begin = .; |
---|
116 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
117 | _TLS_Data_end = .; |
---|
118 | } >ram |
---|
119 | |
---|
120 | .tbss : { |
---|
121 | _TLS_BSS_begin = .; |
---|
122 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
123 | _TLS_BSS_end = .; |
---|
124 | } >ram |
---|
125 | |
---|
126 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
127 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
128 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
129 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
130 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
131 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
132 | |
---|
133 | .data : { |
---|
134 | _copy_start = .; |
---|
135 | *(.data*) |
---|
136 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
137 | *(.gnu.linkonce.d*) |
---|
138 | *(.gcc_except_table*) |
---|
139 | *(.jcr) |
---|
140 | . = ALIGN (16); |
---|
141 | PROVIDE (edata = .); |
---|
142 | _copy_end = .; |
---|
143 | } >ram |
---|
144 | .bss : { |
---|
145 | M68Kvec = .; |
---|
146 | . += (256 * 4); |
---|
147 | _clear_start = .; |
---|
148 | *(.dynbss) |
---|
149 | *(.bss* .gnu.linkonce.b.*) |
---|
150 | *(COMMON) |
---|
151 | . = ALIGN (16); |
---|
152 | PROVIDE (end = .); |
---|
153 | |
---|
154 | . += _StackSize; |
---|
155 | . = ALIGN (16); |
---|
156 | _stack_init = .; |
---|
157 | _clear_end = .; |
---|
158 | |
---|
159 | WorkAreaBase = .; |
---|
160 | } >ram |
---|
161 | |
---|
162 | /* |
---|
163 | * On-chip memory/peripherals |
---|
164 | */ |
---|
165 | dpram : { |
---|
166 | m360 = .; |
---|
167 | . += (8 * 1024); |
---|
168 | } >dpram |
---|
169 | |
---|
170 | /* Stabs debugging sections. */ |
---|
171 | .stab 0 : { *(.stab) } |
---|
172 | .stabstr 0 : { *(.stabstr) } |
---|
173 | .stab.excl 0 : { *(.stab.excl) } |
---|
174 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
175 | .stab.index 0 : { *(.stab.index) } |
---|
176 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
177 | .comment 0 : { *(.comment) } |
---|
178 | |
---|
179 | /* DWARF debug sections. |
---|
180 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
181 | of the section so we begin them at 0. */ |
---|
182 | /* DWARF 1 */ |
---|
183 | .debug 0 : { *(.debug) } |
---|
184 | .line 0 : { *(.line) } |
---|
185 | |
---|
186 | /* GNU DWARF 1 extensions */ |
---|
187 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
188 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
189 | |
---|
190 | /* DWARF 1.1 and DWARF 2 */ |
---|
191 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
192 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
193 | |
---|
194 | /* DWARF 2 */ |
---|
195 | .debug_info 0 : { *(.debug_info) } |
---|
196 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
197 | .debug_line 0 : { *(.debug_line) } |
---|
198 | .debug_frame 0 : { *(.debug_frame) } |
---|
199 | .debug_str 0 : { *(.debug_str) } |
---|
200 | .debug_loc 0 : { *(.debug_loc) } |
---|
201 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
202 | |
---|
203 | /* SGI/MIPS DWARF 2 extensions */ |
---|
204 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
205 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
206 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
207 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
208 | /* These must appear regardless of . */ |
---|
209 | } |
---|