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.OARcorp.com/rtems/license.html. |
---|
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 | /* Base address and size of RAM on the MVME167 */ |
---|
25 | |
---|
26 | RAM_SIZE = 4M; |
---|
27 | RAM_START = 0x00800000; |
---|
28 | RAM_END = RAM_START + RAM_SIZE; |
---|
29 | |
---|
30 | /* |
---|
31 | * Declare some sizes. |
---|
32 | */ |
---|
33 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
34 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
35 | |
---|
36 | MEMORY |
---|
37 | { |
---|
38 | /* The location of RAM is the address space is configurable. |
---|
39 | This is where we put one board. The base address should be |
---|
40 | passed as a parameter when building multiprocessor images |
---|
41 | where each board resides at a different address. */ |
---|
42 | ram : org = 0x00800000, l = 4M |
---|
43 | rom : org = 0xFF800000, l = 4M |
---|
44 | sram : org = 0xFFE00000, l = 128K |
---|
45 | } |
---|
46 | |
---|
47 | SECTIONS |
---|
48 | { |
---|
49 | ram : { |
---|
50 | . = .; |
---|
51 | } >ram |
---|
52 | |
---|
53 | /* |
---|
54 | * Text, data and bss segments |
---|
55 | */ |
---|
56 | .text : { |
---|
57 | *(.text) |
---|
58 | |
---|
59 | /* |
---|
60 | * C++ constructors/destructors |
---|
61 | */ |
---|
62 | *(.gnu.linkonce.t.*) |
---|
63 | |
---|
64 | /* |
---|
65 | * Initialization and finalization code. |
---|
66 | * |
---|
67 | * Various files can provide initialization and finalization |
---|
68 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
69 | * body of these functions are in .init and .fini sections. We |
---|
70 | * accumulate the bodies here, and prepend function prologues |
---|
71 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
72 | * be linked first; crtn.o must be linked last. Because these |
---|
73 | * are wildcards, it doesn't matter if the user does not |
---|
74 | * actually link against crti.o and crtn.o; the linker won't |
---|
75 | * look for a file to match a wildcard. The wildcard also |
---|
76 | * means that it doesn't matter which directory crti.o and |
---|
77 | * crtn.o are in. |
---|
78 | */ |
---|
79 | PROVIDE (_init = .); |
---|
80 | *crti.o(.init) |
---|
81 | *(.init) |
---|
82 | *crtn.o(.init) |
---|
83 | PROVIDE (_fini = .); |
---|
84 | *crti.o(.fini) |
---|
85 | *(.fini) |
---|
86 | *crtn.o(.fini) |
---|
87 | |
---|
88 | /* |
---|
89 | * C++ constructors/destructors |
---|
90 | * |
---|
91 | * gcc uses crtbegin.o to find the start of the constructors |
---|
92 | * and destructors so we make sure it is first. Because this |
---|
93 | * is a wildcard, it doesn't matter if the user does not |
---|
94 | * actually link against crtbegin.o; the linker won't look for |
---|
95 | * a file to match a wildcard. The wildcard also means that |
---|
96 | * it doesn't matter which directory crtbegin.o is in. The |
---|
97 | * constructor and destructor list are terminated in |
---|
98 | * crtend.o. The same comments apply to it. |
---|
99 | */ |
---|
100 | . = ALIGN (16); |
---|
101 | *crtbegin.o(.ctors) |
---|
102 | *(.ctors) |
---|
103 | *crtend.o(.ctors) |
---|
104 | *crtbegin.o(.dtors) |
---|
105 | *(.dtors) |
---|
106 | *crtend.o(.dtors) |
---|
107 | |
---|
108 | /* |
---|
109 | * Exception frame info |
---|
110 | */ |
---|
111 | . = ALIGN (16); |
---|
112 | *(.eh_frame) |
---|
113 | |
---|
114 | /* |
---|
115 | * Read-only data |
---|
116 | */ |
---|
117 | . = ALIGN (16); |
---|
118 | _rodata_start = . ; |
---|
119 | *(.rodata) |
---|
120 | *(.gnu.linkonce.r*) |
---|
121 | |
---|
122 | . = ALIGN (16); |
---|
123 | PROVIDE (_etext = .); |
---|
124 | } >ram |
---|
125 | .data : { |
---|
126 | PROVIDE (_copy_start = .); |
---|
127 | *(.data) |
---|
128 | *(.gnu.linkonce.d*) |
---|
129 | *(.gcc_except_table) |
---|
130 | . = ALIGN (16); |
---|
131 | PROVIDE (_edata = .); |
---|
132 | PROVIDE (_copy_end = .); |
---|
133 | } >ram |
---|
134 | .bss : { |
---|
135 | PROVIDE (_bss_start = .); |
---|
136 | PROVIDE (_clear_start = .); |
---|
137 | *(.bss) |
---|
138 | *(COMMON) |
---|
139 | . = ALIGN (16); |
---|
140 | PROVIDE (end = .); |
---|
141 | |
---|
142 | . += StackSize; |
---|
143 | PROVIDE (_stack_init = .); |
---|
144 | |
---|
145 | . = ALIGN (16); |
---|
146 | PROVIDE (_HeapStart = .); |
---|
147 | . += HeapSize; |
---|
148 | PROVIDE (_HeapEnd = .); |
---|
149 | PROVIDE (_clear_end = .); |
---|
150 | |
---|
151 | PROVIDE (_WorkspaceBase = .); |
---|
152 | } >ram |
---|
153 | } |
---|