1 | /* |
---|
2 | * This file contains GNU linker directives for a generic MC68360 board. |
---|
3 | * Variations in hardware type and dynamic memory size can be made |
---|
4 | * by overriding some values with linker command-line arguments. |
---|
5 | * |
---|
6 | * These linker directives are for producing a BOOTP PROM. |
---|
7 | * To create the PROM image from the linker output you must use objcopy |
---|
8 | * (--adjust-section-vma) to place the data segment at the end of the text |
---|
9 | * segment in the PROM. The start-up code takes care of copying this region |
---|
10 | * to RAM. |
---|
11 | * |
---|
12 | * Saskatchewan Accelerator Laboratory |
---|
13 | * University of Saskatchewan |
---|
14 | * Saskatoon, Saskatchewan, CANADA |
---|
15 | * eric@skatter.usask.ca |
---|
16 | * |
---|
17 | * $Id$ |
---|
18 | */ |
---|
19 | |
---|
20 | /* |
---|
21 | * a.out format doesn't handle prom images very well |
---|
22 | */ |
---|
23 | OUTPUT_FORMAT(coff-m68k) |
---|
24 | |
---|
25 | /* |
---|
26 | * Declare some sizes. |
---|
27 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
28 | * number used there is not constant. If this happens to you, edit |
---|
29 | * the lines marked XXX below to use a constant value. |
---|
30 | */ |
---|
31 | RamSize = DEFINED(RamSize) ? RamSize : 4M; |
---|
32 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
33 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
34 | |
---|
35 | /* |
---|
36 | * Declare hardware type |
---|
37 | */ |
---|
38 | MC68360HardwareTypeMotorolaGeneric = 0; |
---|
39 | MC68360HardwareTypeAtlasHSB = 1; |
---|
40 | MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; |
---|
41 | |
---|
42 | /* |
---|
43 | * Declare on-board memory. |
---|
44 | * It would be nice if the ram length could be given as |
---|
45 | * LENGTH=RamSize, but gld doesn't allow non-constant |
---|
46 | * values in the LENGTH expression. |
---|
47 | */ |
---|
48 | MEMORY { |
---|
49 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
50 | rom : ORIGIN = 0xFF000000, LENGTH = 1M |
---|
51 | dpram : ORIGIN = 0xFE000000, LENGTH = 8k |
---|
52 | } |
---|
53 | |
---|
54 | /* |
---|
55 | * Declare low-order three octets of Ethernet address. |
---|
56 | */ |
---|
57 | ETHERNET_ADDRESS = DEFINED(ETHERNET_ADDRESS) ? ETHERNET_ADDRESS : 0xDEAD12; |
---|
58 | |
---|
59 | /* |
---|
60 | * Declare hardware type. |
---|
61 | * Acceptable values are: |
---|
62 | * 0 - Generic system as described in the MC68360 User's Manual |
---|
63 | * (MC68360UM/AD Rev. 1). |
---|
64 | * 1 - ATLAS Computer Equipment Incorporated ACE360/HSB. |
---|
65 | */ |
---|
66 | MC68360HardwareType = DEFINED(MC68360HardwareType) ? MC68360HardwareType : 0; |
---|
67 | |
---|
68 | /* |
---|
69 | * Load objects |
---|
70 | */ |
---|
71 | SECTIONS { |
---|
72 | /* |
---|
73 | * Hardware variations |
---|
74 | */ |
---|
75 | _RamSize = RamSize; |
---|
76 | __RamSize = RamSize; |
---|
77 | _MC68360HardwareType = MC68360HardwareType; |
---|
78 | __MC68360HardwareType = MC68360HardwareType; |
---|
79 | _MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; |
---|
80 | __MC68360HardwareTypeMotorolaGeneric = MC68360HardwareTypeMotorolaGeneric; |
---|
81 | _MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; |
---|
82 | __MC68360HardwareTypeAtlasHSB = MC68360HardwareTypeAtlasHSB; |
---|
83 | |
---|
84 | /* |
---|
85 | * Boot PROM |
---|
86 | */ |
---|
87 | rom : { |
---|
88 | _RomBase = .; |
---|
89 | __RomBase = .; |
---|
90 | } >rom |
---|
91 | |
---|
92 | /* |
---|
93 | * Dynamic RAM |
---|
94 | */ |
---|
95 | ram : { |
---|
96 | _RamBase = .; |
---|
97 | __RamBase = .; |
---|
98 | } >ram |
---|
99 | |
---|
100 | /* |
---|
101 | * Text, data and bss segments |
---|
102 | */ |
---|
103 | .text : { |
---|
104 | CREATE_OBJECT_SYMBOLS |
---|
105 | *(.text) |
---|
106 | . = ALIGN (16); |
---|
107 | etext = .; |
---|
108 | _etext = .; |
---|
109 | |
---|
110 | /* |
---|
111 | * C++ constructors |
---|
112 | */ |
---|
113 | __CTOR_LIST__ = .; |
---|
114 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
115 | *(.ctors) |
---|
116 | LONG(0) |
---|
117 | __CTOR_END__ = .; |
---|
118 | __DTOR_LIST__ = .; |
---|
119 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
120 | *(.dtors) |
---|
121 | LONG(0) |
---|
122 | __DTOR_END__ = .; |
---|
123 | } >rom |
---|
124 | .data : { |
---|
125 | copy_start = .; |
---|
126 | *(.data) |
---|
127 | . = ALIGN (16); |
---|
128 | _edata = .; |
---|
129 | copy_end = .; |
---|
130 | } >ram |
---|
131 | .bss : { |
---|
132 | M68Kvec = .; |
---|
133 | _M68Kvec = .; |
---|
134 | . += (256 * 4); |
---|
135 | clear_start = .; |
---|
136 | *(.bss) |
---|
137 | *(COMMON) |
---|
138 | . = ALIGN (16); |
---|
139 | _end = .; |
---|
140 | |
---|
141 | _HeapStart = .; |
---|
142 | __HeapStart = .; |
---|
143 | . += HeapSize; /* XXX -- Old gld can't handle this */ |
---|
144 | . += StackSize; /* XXX -- Old gld can't handle this */ |
---|
145 | /* . += 0x10000; */ /* HeapSize for old gld */ |
---|
146 | /* . += 0x1000; */ /* StackSize for old gld */ |
---|
147 | . = ALIGN (16); |
---|
148 | stack_init = .; |
---|
149 | clear_end = .; |
---|
150 | |
---|
151 | _WorkspaceBase = .; |
---|
152 | __WorkspaceBase = .; |
---|
153 | } >ram |
---|
154 | |
---|
155 | /* |
---|
156 | * On-chip memory/peripherals |
---|
157 | */ |
---|
158 | dpram : { |
---|
159 | m360 = .; |
---|
160 | _m360 = .; |
---|
161 | . += (8 * 1024); |
---|
162 | |
---|
163 | } >dpram |
---|
164 | } |
---|