1 | /* linkcmds |
---|
2 | */ |
---|
3 | |
---|
4 | OUTPUT_ARCH(m68k) |
---|
5 | ENTRY(start) |
---|
6 | STARTUP(start.o) |
---|
7 | __DYNAMIC = 0; |
---|
8 | |
---|
9 | /* |
---|
10 | * ROM: |
---|
11 | * +--------------------+ <- low memory |
---|
12 | * | .text | |
---|
13 | * | etext | |
---|
14 | * | ctor list | the ctor and dtor lists are for |
---|
15 | * | dtor list | C++ support |
---|
16 | * | _endtext | |
---|
17 | * | temporary .data | .data is moved to RAM by crt0 |
---|
18 | * | | |
---|
19 | * +--------------------+ <- high memory |
---|
20 | * |
---|
21 | * |
---|
22 | * RAM: |
---|
23 | * +--------------------+ <- low memory |
---|
24 | * | .data | initialized data goes here |
---|
25 | * | _sdata | |
---|
26 | * | _edata | |
---|
27 | * +--------------------+ |
---|
28 | * | .bss | |
---|
29 | * | __bss_start | start of bss, cleared by crt0 |
---|
30 | * | _end | start of heap, used by sbrk() |
---|
31 | * +--------------------+ |
---|
32 | * | heap space | |
---|
33 | * | _ENDHEAP | |
---|
34 | * | stack space | |
---|
35 | * +--------------------+ <- high memory |
---|
36 | */ |
---|
37 | |
---|
38 | /* |
---|
39 | * Declare some sizes. |
---|
40 | */ |
---|
41 | RomBase = DEFINED(RomBase) ? RomBase : 0x90000; |
---|
42 | RamBase = DEFINED(RamBase) ? RamBase : 0x03000; |
---|
43 | RamSize = DEFINED(RamSize) ? RamSize : 0x7d000; |
---|
44 | _RamEnd = RamBase + RamSize; |
---|
45 | |
---|
46 | MEMORY |
---|
47 | { |
---|
48 | rom : ORIGIN = 0x90000, LENGTH = 0x70000 |
---|
49 | ram : ORIGIN = 0x03000, LENGTH = 0x7d000 |
---|
50 | } |
---|
51 | |
---|
52 | _copy_data_from_rom = 1; |
---|
53 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
54 | |
---|
55 | |
---|
56 | /* |
---|
57 | * |
---|
58 | */ |
---|
59 | SECTIONS |
---|
60 | { |
---|
61 | .text : |
---|
62 | { |
---|
63 | . = .; |
---|
64 | text_start = .; |
---|
65 | _text_start = .; |
---|
66 | *(.text*) |
---|
67 | . = ALIGN (16); |
---|
68 | |
---|
69 | /* |
---|
70 | * C++ constructors/destructors |
---|
71 | */ |
---|
72 | *(.gnu.linkonce.t.*) |
---|
73 | |
---|
74 | /* |
---|
75 | * Initialization and finalization code. |
---|
76 | * |
---|
77 | * Various files can provide initialization and finalization |
---|
78 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
79 | * body of these functions are in .init and .fini sections. We |
---|
80 | * accumulate the bodies here, and prepend function prologues |
---|
81 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
82 | * be linked first; crtn.o must be linked last. Because these |
---|
83 | * are wildcards, it doesn't matter if the user does not |
---|
84 | * actually link against crti.o and crtn.o; the linker won't |
---|
85 | * look for a file to match a wildcard. The wildcard also |
---|
86 | * means that it doesn't matter which directory crti.o and |
---|
87 | * crtn.o are in. |
---|
88 | */ |
---|
89 | PROVIDE (_init = .); |
---|
90 | *crti.o(.init) |
---|
91 | *(.init) |
---|
92 | *crtn.o(.init) |
---|
93 | PROVIDE (_fini = .); |
---|
94 | *crti.o(.fini) |
---|
95 | *(.fini) |
---|
96 | *crtn.o(.fini) |
---|
97 | |
---|
98 | /* |
---|
99 | * Special FreeBSD sysctl sections. |
---|
100 | */ |
---|
101 | . = ALIGN (16); |
---|
102 | __start_set_sysctl_set = .; |
---|
103 | *(set_sysctl_*); |
---|
104 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
105 | *(set_domain_*); |
---|
106 | *(set_pseudo_*); |
---|
107 | |
---|
108 | /* |
---|
109 | * C++ constructors/destructors |
---|
110 | * |
---|
111 | * gcc uses crtbegin.o to find the start of the constructors |
---|
112 | * and destructors so we make sure it is first. Because this |
---|
113 | * is a wildcard, it doesn't matter if the user does not |
---|
114 | * actually link against crtbegin.o; the linker won't look for |
---|
115 | * a file to match a wildcard. The wildcard also means that |
---|
116 | * it doesn't matter which directory crtbegin.o is in. The |
---|
117 | * constructor and destructor list are terminated in |
---|
118 | * crtend.o. The same comments apply to it. |
---|
119 | */ |
---|
120 | . = ALIGN (16); |
---|
121 | *crtbegin.o(.ctors) |
---|
122 | *(.ctors) |
---|
123 | *crtend.o(.ctors) |
---|
124 | *crtbegin.o(.dtors) |
---|
125 | *(.dtors) |
---|
126 | *crtend.o(.dtors) |
---|
127 | |
---|
128 | /* |
---|
129 | * Exception frame info |
---|
130 | */ |
---|
131 | . = ALIGN (16); |
---|
132 | *(.eh_frame) |
---|
133 | |
---|
134 | /* |
---|
135 | * Read-only data |
---|
136 | */ |
---|
137 | . = ALIGN (16); |
---|
138 | _rodata_start = . ; |
---|
139 | *(.rodata*) |
---|
140 | KEEP (*(SORT(.rtemsroset.*))) |
---|
141 | *(.gnu.linkonce.r*) |
---|
142 | |
---|
143 | . = ALIGN (16); |
---|
144 | PROVIDE (_etext = .); |
---|
145 | _endtext = .; |
---|
146 | __data_start_rom = .; |
---|
147 | } > rom |
---|
148 | .tdata : { |
---|
149 | _TLS_Data_begin = .; |
---|
150 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
151 | _TLS_Data_end = .; |
---|
152 | } > rom |
---|
153 | .tbss : { |
---|
154 | _TLS_BSS_begin = .; |
---|
155 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
156 | _TLS_BSS_end = .; |
---|
157 | } > rom |
---|
158 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
159 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
160 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
161 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
162 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
163 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
164 | .gcc_exc : |
---|
165 | AT ( ADDR(.tdata) + SIZEOF( .tdata ) ) |
---|
166 | { |
---|
167 | *(.gcc_exc) |
---|
168 | } > ram |
---|
169 | .data : AT(__data_start_rom) |
---|
170 | { |
---|
171 | PROVIDE (_copy_start = .); |
---|
172 | *(.data*) |
---|
173 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
174 | *(.gnu.linkonce.d*) |
---|
175 | *(.gcc_except_table*) |
---|
176 | *(.jcr) |
---|
177 | . = ALIGN (16); |
---|
178 | PROVIDE (_edata = .); |
---|
179 | PROVIDE (_copy_end = .); |
---|
180 | } > ram |
---|
181 | .shbss : |
---|
182 | { |
---|
183 | *(.shbss) |
---|
184 | } > ram |
---|
185 | .bss : |
---|
186 | { |
---|
187 | M68Kvec = .; |
---|
188 | . += (256 * 4); |
---|
189 | _clear_start = .; |
---|
190 | *(.dynbss) |
---|
191 | *(.bss* .gnu.linkonce.b.*) |
---|
192 | *(COMMON) |
---|
193 | . = ALIGN (16); |
---|
194 | PROVIDE (end = .); |
---|
195 | _clear_end = .; |
---|
196 | } > ram |
---|
197 | .rtemsstack (NOLOAD) : { |
---|
198 | *(SORT(.rtemsstack.*)) |
---|
199 | WorkAreaBase = .; |
---|
200 | } > ram |
---|
201 | .stab . (NOLOAD) : |
---|
202 | { |
---|
203 | [ .stab ] |
---|
204 | } |
---|
205 | .stabstr . (NOLOAD) : |
---|
206 | { |
---|
207 | [ .stabstr ] |
---|
208 | } |
---|
209 | } |
---|