1 | /* |
---|
2 | * This file contains directives for the GNU linker which are specific |
---|
3 | * to the Motorola MVME167 board. This linker script produces ELF |
---|
4 | * executables. |
---|
5 | * |
---|
6 | * Copyright (c) 1999, National Research Council of Canada. |
---|
7 | * Some of this material was copied from binutils-2.9.4 linker scripts, |
---|
8 | * and is therefore likely to be copyrighted by the Free Software |
---|
9 | * Foundation, even though explicit copyright notices did not appear in |
---|
10 | * those files. |
---|
11 | * |
---|
12 | * The license and distribution terms for this file may be |
---|
13 | * found in the file LICENSE in this distribution or at |
---|
14 | * http://www.rtems.com/license/LICENSE. |
---|
15 | * |
---|
16 | * $Id$ |
---|
17 | */ |
---|
18 | |
---|
19 | /* These are not really needed here */ |
---|
20 | OUTPUT_FORMAT("elf32-m68k") |
---|
21 | OUTPUT_ARCH(m68k) |
---|
22 | ENTRY(_start) |
---|
23 | |
---|
24 | /* |
---|
25 | * Declare some sizes. Heap is sized at whatever ram space is left. |
---|
26 | */ |
---|
27 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x00800000; |
---|
28 | _RamSize = DEFINED(_RamSize) ? _RamSize : 4M; |
---|
29 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0; |
---|
30 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
31 | |
---|
32 | MEMORY |
---|
33 | { |
---|
34 | /* The location of RAM is the address space is configurable. |
---|
35 | This is where we put one board. The base address should be |
---|
36 | passed as a parameter when building multiprocessor images |
---|
37 | where each board resides at a different address. */ |
---|
38 | ram : org = 0x00800000, l = 4M |
---|
39 | rom : org = 0xFF800000, l = 4M |
---|
40 | sram : org = 0xFFE00000, l = 128K |
---|
41 | } |
---|
42 | |
---|
43 | SECTIONS |
---|
44 | { |
---|
45 | /* |
---|
46 | * Text, data and bss segments |
---|
47 | */ |
---|
48 | .text : { |
---|
49 | *(.text) |
---|
50 | |
---|
51 | /* |
---|
52 | * C++ constructors/destructors |
---|
53 | */ |
---|
54 | *(.gnu.linkonce.t.*) |
---|
55 | |
---|
56 | /* |
---|
57 | * Initialization and finalization code. |
---|
58 | * |
---|
59 | * Various files can provide initialization and finalization |
---|
60 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
61 | * body of these functions are in .init and .fini sections. We |
---|
62 | * accumulate the bodies here, and prepend function prologues |
---|
63 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
64 | * be linked first; crtn.o must be linked last. Because these |
---|
65 | * are wildcards, it doesn't matter if the user does not |
---|
66 | * actually link against crti.o and crtn.o; the linker won't |
---|
67 | * look for a file to match a wildcard. The wildcard also |
---|
68 | * means that it doesn't matter which directory crti.o and |
---|
69 | * crtn.o are in. |
---|
70 | */ |
---|
71 | PROVIDE (_init = .); |
---|
72 | *crti.o(.init) |
---|
73 | *(.init) |
---|
74 | *crtn.o(.init) |
---|
75 | |
---|
76 | PROVIDE (_fini = .); |
---|
77 | *crti.o(.fini) |
---|
78 | *(.fini) |
---|
79 | *crtn.o(.fini) |
---|
80 | |
---|
81 | /* |
---|
82 | * Special FreeBSD sysctl sections. |
---|
83 | */ |
---|
84 | . = ALIGN (16); |
---|
85 | __start_set_sysctl_set = .; |
---|
86 | *(set_sysctl_*); |
---|
87 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
88 | *(set_domain_*); |
---|
89 | *(set_pseudo_*); |
---|
90 | |
---|
91 | /* |
---|
92 | * C++ constructors/destructors |
---|
93 | * |
---|
94 | * gcc uses crtbegin.o to find the start of the constructors |
---|
95 | * and destructors so we make sure it is first. Because this |
---|
96 | * is a wildcard, it doesn't matter if the user does not |
---|
97 | * actually link against crtbegin.o; the linker won't look for |
---|
98 | * a file to match a wildcard. The wildcard also means that |
---|
99 | * it doesn't matter which directory crtbegin.o is in. The |
---|
100 | * constructor and destructor list are terminated in |
---|
101 | * crtend.o. The same comments apply to it. |
---|
102 | */ |
---|
103 | . = ALIGN (16); |
---|
104 | *crtbegin.o(.ctors) |
---|
105 | *(.ctors) |
---|
106 | *crtend.o(.ctors) |
---|
107 | |
---|
108 | *crtbegin.o(.dtors) |
---|
109 | *(.dtors) |
---|
110 | *crtend.o(.dtors) |
---|
111 | |
---|
112 | /* |
---|
113 | * Exception frame info |
---|
114 | */ |
---|
115 | . = ALIGN (16); |
---|
116 | *(.eh_frame) |
---|
117 | |
---|
118 | /* |
---|
119 | * Read-only data |
---|
120 | */ |
---|
121 | . = ALIGN (16); |
---|
122 | _rodata_start = .; |
---|
123 | *(.rodata*) |
---|
124 | *(.gnu.linkonce.r*) |
---|
125 | PROVIDE(_erodata = . ); |
---|
126 | |
---|
127 | . = ALIGN (16); |
---|
128 | PROVIDE (_etext = .); |
---|
129 | } >ram |
---|
130 | |
---|
131 | .data : { |
---|
132 | PROVIDE (_copy_start = .); |
---|
133 | *(.data) |
---|
134 | *(.gnu.linkonce.d*) |
---|
135 | *(.gcc_except_table) |
---|
136 | *(.jcr) |
---|
137 | . = ALIGN (16); |
---|
138 | PROVIDE (_edata = .); |
---|
139 | PROVIDE (_copy_end = .); |
---|
140 | } >ram |
---|
141 | |
---|
142 | .bss : { |
---|
143 | _clear_start = .; |
---|
144 | *(.bss) |
---|
145 | *(COMMON) |
---|
146 | . = ALIGN (16); |
---|
147 | PROVIDE (end = .); |
---|
148 | |
---|
149 | . += _StackSize; |
---|
150 | . = ALIGN (16); |
---|
151 | _stack_init = .; |
---|
152 | _clear_end = .; |
---|
153 | |
---|
154 | _WorkspaceBase = .; |
---|
155 | } >ram |
---|
156 | |
---|
157 | /* Stabs debugging sections. */ |
---|
158 | .stab 0 : { *(.stab) } |
---|
159 | .stabstr 0 : { *(.stabstr) } |
---|
160 | .stab.excl 0 : { *(.stab.excl) } |
---|
161 | .stab.exclstr 0 : { *(.stab.exclstr) } |
---|
162 | .stab.index 0 : { *(.stab.index) } |
---|
163 | .stab.indexstr 0 : { *(.stab.indexstr) } |
---|
164 | .comment 0 : { *(.comment) } |
---|
165 | |
---|
166 | /* DWARF debug sections. |
---|
167 | Symbols in the DWARF debugging sections are relative to the beginning |
---|
168 | of the section so we begin them at 0. */ |
---|
169 | /* DWARF 1 */ |
---|
170 | .debug 0 : { *(.debug) } |
---|
171 | .line 0 : { *(.line) } |
---|
172 | |
---|
173 | /* GNU DWARF 1 extensions */ |
---|
174 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
175 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
176 | |
---|
177 | /* DWARF 1.1 and DWARF 2 */ |
---|
178 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
179 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
180 | |
---|
181 | /* DWARF 2 */ |
---|
182 | .debug_info 0 : { *(.debug_info) } |
---|
183 | .debug_abbrev 0 : { *(.debug_abbrev) } |
---|
184 | .debug_line 0 : { *(.debug_line) } |
---|
185 | .debug_frame 0 : { *(.debug_frame) } |
---|
186 | .debug_str 0 : { *(.debug_str) } |
---|
187 | .debug_loc 0 : { *(.debug_loc) } |
---|
188 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
189 | |
---|
190 | /* SGI/MIPS DWARF 2 extensions */ |
---|
191 | .debug_weaknames 0 : { *(.debug_weaknames) } |
---|
192 | .debug_funcnames 0 : { *(.debug_funcnames) } |
---|
193 | .debug_typenames 0 : { *(.debug_typenames) } |
---|
194 | .debug_varnames 0 : { *(.debug_varnames) } |
---|
195 | /* These must appear regardless of . */ |
---|
196 | } |
---|