1 | /* linkcmds |
---|
2 | * |
---|
3 | * $Id$ |
---|
4 | */ |
---|
5 | |
---|
6 | OUTPUT_ARCH(m68k) |
---|
7 | STARTUP(except_vect_332_ROM.o) |
---|
8 | __DYNAMIC = 0; |
---|
9 | |
---|
10 | /* |
---|
11 | * The memory map looks like this: |
---|
12 | * ROM: |
---|
13 | * +--------------------+ <- low memory |
---|
14 | * | .text | |
---|
15 | * | etext | |
---|
16 | * | ctor list | the ctor and dtor lists are for |
---|
17 | * | dtor list | C++ support |
---|
18 | * | _endtext | |
---|
19 | * | temporary .data | .data is moved to RAM by crt0 |
---|
20 | * | | |
---|
21 | * +--------------------+ <- high memory |
---|
22 | * |
---|
23 | * |
---|
24 | * RAM: |
---|
25 | * +--------------------+ <- low memory |
---|
26 | * | _RamBase | |
---|
27 | * | .data | initialized data goes here |
---|
28 | * | _sdata | |
---|
29 | * | _edata | |
---|
30 | * +--------------------+ |
---|
31 | * | .bss | |
---|
32 | * | _clear_start| start of bss, cleared by crt0 |
---|
33 | * | _end | start of heap, used by sbrk() |
---|
34 | * +--------------------+ |
---|
35 | * | _WorkspaceBase |
---|
36 | * | work space | |
---|
37 | * | heapStart | |
---|
38 | * | heap space | |
---|
39 | * | _RamEnd | top of stack |
---|
40 | * +--------------------+ <- high memory |
---|
41 | */ |
---|
42 | |
---|
43 | /* |
---|
44 | * Declare some sizes. |
---|
45 | */ |
---|
46 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x80000; |
---|
47 | _RamSize = DEFINED(_RamSize) ? _RamSize : 0x40000; |
---|
48 | _RamEnd = _RamBase + _RamSize; |
---|
49 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000; |
---|
50 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
51 | |
---|
52 | MEMORY |
---|
53 | { |
---|
54 | rom : ORIGIN = 0x00000, LENGTH = 256K |
---|
55 | ram : ORIGIN = 0x80000, LENGTH = 256K |
---|
56 | } |
---|
57 | |
---|
58 | _copy_data_from_rom = 1; |
---|
59 | |
---|
60 | /* |
---|
61 | * |
---|
62 | */ |
---|
63 | SECTIONS |
---|
64 | { |
---|
65 | ram : { |
---|
66 | . = .; |
---|
67 | } >ram |
---|
68 | |
---|
69 | /* |
---|
70 | * Text, data and bss segments |
---|
71 | */ |
---|
72 | .text : { |
---|
73 | *(.text) |
---|
74 | |
---|
75 | /* |
---|
76 | * C++ constructors/destructors |
---|
77 | */ |
---|
78 | *(.gnu.linkonce.t.*) |
---|
79 | |
---|
80 | /* |
---|
81 | * Initialization and finalization code. |
---|
82 | * |
---|
83 | * Various files can provide initialization and finalization |
---|
84 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
85 | * body of these functions are in .init and .fini sections. We |
---|
86 | * accumulate the bodies here, and prepend function prologues |
---|
87 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
88 | * be linked first; crtn.o must be linked last. Because these |
---|
89 | * are wildcards, it doesn't matter if the user does not |
---|
90 | * actually link against crti.o and crtn.o; the linker won't |
---|
91 | * look for a file to match a wildcard. The wildcard also |
---|
92 | * means that it doesn't matter which directory crti.o and |
---|
93 | * crtn.o are in. |
---|
94 | */ |
---|
95 | PROVIDE (_init = .); |
---|
96 | *crti.o(.init) |
---|
97 | *(.init) |
---|
98 | *crtn.o(.init) |
---|
99 | PROVIDE (_fini = .); |
---|
100 | *crti.o(.fini) |
---|
101 | *(.fini) |
---|
102 | *crtn.o(.fini) |
---|
103 | |
---|
104 | /* |
---|
105 | * Special FreeBSD sysctl sections. |
---|
106 | */ |
---|
107 | . = ALIGN (16); |
---|
108 | __start_set_sysctl_set = .; |
---|
109 | *(set_sysctl_*); |
---|
110 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
111 | *(set_domain_*); |
---|
112 | *(set_pseudo_*); |
---|
113 | |
---|
114 | /* |
---|
115 | * C++ constructors/destructors |
---|
116 | * |
---|
117 | * gcc uses crtbegin.o to find the start of the constructors |
---|
118 | * and destructors so we make sure it is first. Because this |
---|
119 | * is a wildcard, it doesn't matter if the user does not |
---|
120 | * actually link against crtbegin.o; the linker won't look for |
---|
121 | * a file to match a wildcard. The wildcard also means that |
---|
122 | * it doesn't matter which directory crtbegin.o is in. The |
---|
123 | * constructor and destructor list are terminated in |
---|
124 | * crtend.o. The same comments apply to it. |
---|
125 | */ |
---|
126 | . = ALIGN (16); |
---|
127 | *crtbegin.o(.ctors) |
---|
128 | *(.ctors) |
---|
129 | *crtend.o(.ctors) |
---|
130 | *crtbegin.o(.dtors) |
---|
131 | *(.dtors) |
---|
132 | *crtend.o(.dtors) |
---|
133 | |
---|
134 | /* |
---|
135 | * Exception frame info |
---|
136 | */ |
---|
137 | . = ALIGN (16); |
---|
138 | *(.eh_frame) |
---|
139 | |
---|
140 | /* |
---|
141 | * Read-only data |
---|
142 | */ |
---|
143 | . = ALIGN (16); |
---|
144 | _rodata_start = . ; |
---|
145 | *(.rodata) |
---|
146 | *(.gnu.linkonce.r*) |
---|
147 | |
---|
148 | . = ALIGN (16); |
---|
149 | PROVIDE (_etext = .); |
---|
150 | } >rom |
---|
151 | .data : |
---|
152 | AT ( ADDR(.text) + SIZEOF( .text ) ) |
---|
153 | { |
---|
154 | PROVIDE (_copy_start = .); |
---|
155 | *(.data) |
---|
156 | *(.gnu.linkonce.d*) |
---|
157 | *(.gcc_except_table) |
---|
158 | . = ALIGN (16); |
---|
159 | PROVIDE (_edata = .); |
---|
160 | PROVIDE (_copy_end = .); |
---|
161 | } >ram |
---|
162 | .bss : { |
---|
163 | _clear_start = .; |
---|
164 | *(.bss) |
---|
165 | *(COMMON) |
---|
166 | . = ALIGN (16); |
---|
167 | PROVIDE (end = .); |
---|
168 | |
---|
169 | . += _StackSize; |
---|
170 | . = ALIGN (16); |
---|
171 | _stack_init = .; |
---|
172 | _clear_end = .; |
---|
173 | |
---|
174 | _WorkspaceBase = .; |
---|
175 | } >ram |
---|
176 | |
---|
177 | /* Stabs debugging sections. */ |
---|
178 | .stab 0 : { *(.stab) } |
---|
179 | .stabstr 0 : { *(.stabstr) } |
---|
180 | .stab.excl 0 : { *(.stab.excl) } |
---|
181 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
182 | .stab.index 0 : { *(.stab.index) } |
---|
183 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
184 | .comment 0 : { *(.comment) } |
---|
185 | |
---|
186 | /* DWARF debug sections. |
---|
187 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
188 | of the section so we begin them at 0. */ |
---|
189 | /* DWARF 1 */ |
---|
190 | .debug 0 : { *(.debug) } |
---|
191 | .line 0 : { *(.line) } |
---|
192 | |
---|
193 | /* GNU DWARF 1 extensions */ |
---|
194 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
195 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
196 | |
---|
197 | /* DWARF 1.1 and DWARF 2 */ |
---|
198 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
199 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
200 | |
---|
201 | /* DWARF 2 */ |
---|
202 | .debug_info 0 : { *(.debug_info) } |
---|
203 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
204 | .debug_line 0 : { *(.debug_line) } |
---|
205 | .debug_frame 0 : { *(.debug_frame) } |
---|
206 | .debug_str 0 : { *(.debug_str) } |
---|
207 | .debug_loc 0 : { *(.debug_loc) } |
---|
208 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
209 | |
---|
210 | /* SGI/MIPS DWARF 2 extensions */ |
---|
211 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
212 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
213 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
214 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
215 | /* These must appear regardless of . */ |
---|
216 | } |
---|