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 PROM version. |
---|
7 | * The data segment is placed at the end of the text segment in the PROM. |
---|
8 | * The start-up code takes care of copying this region to RAM. |
---|
9 | * |
---|
10 | * Saskatchewan Accelerator Laboratory |
---|
11 | * University of Saskatchewan |
---|
12 | * Saskatoon, Saskatchewan, CANADA |
---|
13 | * eric@skatter.usask.ca |
---|
14 | * |
---|
15 | * $Id$ |
---|
16 | */ |
---|
17 | |
---|
18 | /* |
---|
19 | * Declare some sizes. |
---|
20 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
21 | * number used there is not constant. If this happens to you, edit |
---|
22 | * the lines marked XXX below to use a constant value. |
---|
23 | */ |
---|
24 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
25 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
26 | |
---|
27 | /* |
---|
28 | * Declare on-board memory. |
---|
29 | */ |
---|
30 | MEMORY { |
---|
31 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
32 | rom : ORIGIN = 0x0F000000, LENGTH = 1M |
---|
33 | dpram : ORIGIN = 0x0E000000, LENGTH = 8k |
---|
34 | } |
---|
35 | |
---|
36 | /* |
---|
37 | * Load objects |
---|
38 | */ |
---|
39 | SECTIONS { |
---|
40 | /* |
---|
41 | * Boot PROM |
---|
42 | */ |
---|
43 | rom : { |
---|
44 | _RomBase = .; |
---|
45 | __RomBase = .; |
---|
46 | } >rom |
---|
47 | |
---|
48 | /* |
---|
49 | * Dynamic RAM |
---|
50 | */ |
---|
51 | ram : { |
---|
52 | _RamBase = .; |
---|
53 | __RamBase = .; |
---|
54 | } >ram |
---|
55 | |
---|
56 | /* |
---|
57 | * Text, data and bss segments |
---|
58 | */ |
---|
59 | .text : AT (0x00000000) { |
---|
60 | CREATE_OBJECT_SYMBOLS |
---|
61 | *(.text) |
---|
62 | . = ALIGN (16); |
---|
63 | |
---|
64 | *(.eh_fram) |
---|
65 | . = ALIGN (16); |
---|
66 | |
---|
67 | /* |
---|
68 | * C++ constructors |
---|
69 | */ |
---|
70 | __CTOR_LIST__ = .; |
---|
71 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
72 | *(.ctors) |
---|
73 | LONG(0) |
---|
74 | __CTOR_END__ = .; |
---|
75 | __DTOR_LIST__ = .; |
---|
76 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
77 | *(.dtors) |
---|
78 | LONG(0) |
---|
79 | __DTOR_END__ = .; |
---|
80 | |
---|
81 | etext = .; |
---|
82 | _etext = .; |
---|
83 | } >rom |
---|
84 | .data : AT(SIZEOF(.text)) { |
---|
85 | copy_start = .; |
---|
86 | *(.data) |
---|
87 | . = ALIGN (16); |
---|
88 | _edata = .; |
---|
89 | copy_end = .; |
---|
90 | } >ram |
---|
91 | .bss : { |
---|
92 | M68Kvec = .; |
---|
93 | _M68Kvec = .; |
---|
94 | . += (256 * 4); |
---|
95 | clear_start = .; |
---|
96 | *(.bss) |
---|
97 | *(COMMON) |
---|
98 | . = ALIGN (16); |
---|
99 | _end = .; |
---|
100 | |
---|
101 | _HeapStart = .; |
---|
102 | __HeapStart = .; |
---|
103 | . += HeapSize; /* XXX -- Old gld can't handle this */ |
---|
104 | . += StackSize; /* XXX -- Old gld can't handle this */ |
---|
105 | /* . += 0x10000; */ /* HeapSize for old gld */ |
---|
106 | /* . += 0x1000; */ /* StackSize for old gld */ |
---|
107 | . = ALIGN (16); |
---|
108 | stack_init = .; |
---|
109 | clear_end = .; |
---|
110 | |
---|
111 | _WorkspaceBase = .; |
---|
112 | __WorkspaceBase = .; |
---|
113 | } >ram |
---|
114 | |
---|
115 | /* |
---|
116 | * On-chip memory/peripherals |
---|
117 | */ |
---|
118 | dpram : { |
---|
119 | m360 = .; |
---|
120 | _m360 = .; |
---|
121 | . += (8 * 1024); |
---|
122 | |
---|
123 | } >dpram |
---|
124 | } |
---|