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 | * These linker directives are for producing a PROM version. |
---|
7 | * The data segment is placed at the end of the text segment in the PROM. |
---|
8 | * The start-up code takes care of copying this region to RAM. |
---|
9 | * |
---|
10 | * Saskatchewan Accelerator Laboratory |
---|
11 | * University of Saskatchewan |
---|
12 | * Saskatoon, Saskatchewan, CANADA |
---|
13 | * eric@skatter.usask.ca |
---|
14 | */ |
---|
15 | |
---|
16 | /* |
---|
17 | * Declare some sizes. |
---|
18 | * A heap size of 0 means `use all available memory for the heap'. |
---|
19 | */ |
---|
20 | RamBase = DEFINED(RamBase) ? RamBase : 0x0; |
---|
21 | RamSize = DEFINED(RamSize) ? RamSize : 64M; |
---|
22 | RamEnd = RamBase + RamSize; |
---|
23 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
24 | |
---|
25 | /* |
---|
26 | * Declare on-board memory. |
---|
27 | */ |
---|
28 | MEMORY { |
---|
29 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
30 | rom : ORIGIN = 0x0F000000, LENGTH = 1M |
---|
31 | dpram : ORIGIN = 0x0E000000, LENGTH = 8k |
---|
32 | } |
---|
33 | |
---|
34 | /* |
---|
35 | * Load objects |
---|
36 | */ |
---|
37 | SECTIONS { |
---|
38 | /* |
---|
39 | * Boot PROM |
---|
40 | */ |
---|
41 | rom : { |
---|
42 | _RomBase = .; |
---|
43 | } >rom |
---|
44 | |
---|
45 | /* |
---|
46 | * Dynamic RAM |
---|
47 | */ |
---|
48 | ram : { |
---|
49 | RamBase = .; |
---|
50 | } >ram |
---|
51 | |
---|
52 | /* |
---|
53 | * Text, data and bss segments |
---|
54 | */ |
---|
55 | .text : AT(0x0) { |
---|
56 | *(.text*) |
---|
57 | |
---|
58 | /* |
---|
59 | * C++ constructors/destructors |
---|
60 | */ |
---|
61 | *(.gnu.linkonce.t.*) |
---|
62 | |
---|
63 | /* |
---|
64 | * Initialization and finalization code. |
---|
65 | */ |
---|
66 | PROVIDE (_init = .); |
---|
67 | *crti.o(.init) |
---|
68 | *(.init) |
---|
69 | *crtn.o(.init) |
---|
70 | PROVIDE (_fini = .); |
---|
71 | *crti.o(.fini) |
---|
72 | *(.fini) |
---|
73 | *crtn.o(.fini) |
---|
74 | |
---|
75 | /* |
---|
76 | * Special FreeBSD sysctl sections. |
---|
77 | */ |
---|
78 | . = ALIGN (16); |
---|
79 | __start_set_sysctl_set = .; |
---|
80 | *(set_sysctl_*); |
---|
81 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
82 | *(set_domain_*); |
---|
83 | *(set_pseudo_*); |
---|
84 | |
---|
85 | /* |
---|
86 | * C++ constructors/destructors |
---|
87 | */ |
---|
88 | . = ALIGN (16); |
---|
89 | *crtbegin.o(.ctors) |
---|
90 | *(.ctors) |
---|
91 | *crtend.o(.ctors) |
---|
92 | *crtbegin.o(.dtors) |
---|
93 | *(.dtors) |
---|
94 | *crtend.o(.dtors) |
---|
95 | |
---|
96 | /* |
---|
97 | * Exception frame info |
---|
98 | */ |
---|
99 | . = ALIGN (16); |
---|
100 | *(.eh_frame) |
---|
101 | |
---|
102 | /* |
---|
103 | * Read-only data |
---|
104 | */ |
---|
105 | . = ALIGN (16); |
---|
106 | _rodata_start = . ; |
---|
107 | *(.rodata*) |
---|
108 | KEEP (*(SORT(.rtemsroset.*))) |
---|
109 | *(.gnu.linkonce.r*) |
---|
110 | |
---|
111 | . = ALIGN (16); |
---|
112 | PROVIDE (etext = .); |
---|
113 | } >rom |
---|
114 | |
---|
115 | .tdata : { |
---|
116 | _TLS_Data_begin = .; |
---|
117 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
118 | _TLS_Data_end = .; |
---|
119 | } >rom |
---|
120 | |
---|
121 | .tbss : { |
---|
122 | _TLS_BSS_begin = .; |
---|
123 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
124 | _TLS_BSS_end = .; |
---|
125 | } >rom |
---|
126 | |
---|
127 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
128 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
129 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
130 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
131 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
132 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
133 | |
---|
134 | .data : AT(SIZEOF(.text)) { |
---|
135 | _copy_start = .; |
---|
136 | *(.data) |
---|
137 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
138 | *(.gnu.linkonce.d*) |
---|
139 | *(.jcr) |
---|
140 | *(.gcc_except_table*) |
---|
141 | . = ALIGN (16); |
---|
142 | PROVIDE (edata = .); |
---|
143 | _copy_end = .; |
---|
144 | } >ram |
---|
145 | .bss : { |
---|
146 | M68Kvec = .; |
---|
147 | . += (256 * 4); |
---|
148 | *(.dynbss) |
---|
149 | *(.bss* .gnu.linkonce.b.*) |
---|
150 | *(COMMON) |
---|
151 | . = ALIGN (16); |
---|
152 | PROVIDE (end = .); |
---|
153 | _clear_end = .; |
---|
154 | } >ram |
---|
155 | |
---|
156 | .rtemsstack (NOLOAD) : { |
---|
157 | *(SORT(.rtemsstack.*)) |
---|
158 | WorkAreaBase = .; |
---|
159 | } >ram |
---|
160 | |
---|
161 | /* |
---|
162 | * On-chip memory/peripherals |
---|
163 | */ |
---|
164 | dpram : { |
---|
165 | m360 = .; |
---|
166 | . += (8 * 1024); |
---|
167 | } >dpram |
---|
168 | } |
---|