1 | /* |
---|
2 | * This file contains GNU linker directives for a generic MC68360 board. |
---|
3 | * Variations in memory size and allocation can be made by |
---|
4 | * overriding some values with linker command-line arguments. |
---|
5 | * |
---|
6 | * Saskatchewan Accelerator Laboratory |
---|
7 | * University of Saskatchewan |
---|
8 | * Saskatoon, Saskatchewan, CANADA |
---|
9 | * eric@skatter.usask.ca |
---|
10 | * |
---|
11 | * $Id$ |
---|
12 | */ |
---|
13 | |
---|
14 | /* |
---|
15 | * Declare some sizes. |
---|
16 | * XXX: The assignment of ". += XyzSize;" fails in older gld's if the |
---|
17 | * number used there is not constant. If this happens to you, edit |
---|
18 | * the lines marked XXX below to use a constant value. |
---|
19 | */ |
---|
20 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x10000; |
---|
21 | StackSize = DEFINED(StackSize) ? StackSize : 0x1000; |
---|
22 | |
---|
23 | /* |
---|
24 | * Declare on-board memory. |
---|
25 | */ |
---|
26 | MEMORY { |
---|
27 | ram : ORIGIN = 0x00000000, LENGTH = 64M |
---|
28 | rom : ORIGIN = 0x0F000000, LENGTH = 1M |
---|
29 | dpram : ORIGIN = 0x0E000000, LENGTH = 8k |
---|
30 | } |
---|
31 | |
---|
32 | /* |
---|
33 | * Load objects |
---|
34 | */ |
---|
35 | SECTIONS { |
---|
36 | /* |
---|
37 | * Boot PROM |
---|
38 | */ |
---|
39 | rom : { |
---|
40 | _RomBase = .; |
---|
41 | __RomBase = .; |
---|
42 | } >rom |
---|
43 | |
---|
44 | /* |
---|
45 | * Dynamic RAM |
---|
46 | */ |
---|
47 | ram : { |
---|
48 | _RamBase = .; |
---|
49 | __RamBase = .; |
---|
50 | } >ram |
---|
51 | |
---|
52 | /* |
---|
53 | * Text, data and bss segments |
---|
54 | */ |
---|
55 | .text : { |
---|
56 | CREATE_OBJECT_SYMBOLS |
---|
57 | *(.text) |
---|
58 | . = ALIGN (16); |
---|
59 | |
---|
60 | *(.gnu.linkonce.t.*) |
---|
61 | *(.descriptors) |
---|
62 | /* .gnu.warning sections are handled specially by elf32.em. */ |
---|
63 | *(.gnu.warning) |
---|
64 | |
---|
65 | *(.eh_fram) |
---|
66 | . = ALIGN (16); |
---|
67 | |
---|
68 | *(.gcc_exc) |
---|
69 | /* |
---|
70 | * C++ constructors |
---|
71 | */ |
---|
72 | __CTOR_LIST__ = .; |
---|
73 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
74 | *(.ctors) |
---|
75 | LONG(0) |
---|
76 | __CTOR_END__ = .; |
---|
77 | __DTOR_LIST__ = .; |
---|
78 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
79 | *(.dtors) |
---|
80 | LONG(0) |
---|
81 | __DTOR_END__ = .; |
---|
82 | |
---|
83 | _rodata_start = . ; |
---|
84 | *(.rodata) |
---|
85 | *(.gnu.linkonce.r*) |
---|
86 | _erodata = ALIGN( 0x10 ) ; |
---|
87 | |
---|
88 | etext = .; |
---|
89 | _etext = .; |
---|
90 | } >ram |
---|
91 | .data : { |
---|
92 | copy_start = .; |
---|
93 | *(.data) |
---|
94 | *(.gnu.linkonce.d*) |
---|
95 | *(.gcc_except_table) |
---|
96 | . = ALIGN (16); |
---|
97 | _edata = .; |
---|
98 | copy_end = .; |
---|
99 | } >ram |
---|
100 | .bss : { |
---|
101 | M68Kvec = .; |
---|
102 | _M68Kvec = .; |
---|
103 | . += (256 * 4); |
---|
104 | clear_start = .; |
---|
105 | *(.bss) |
---|
106 | *(COMMON) |
---|
107 | . = ALIGN (16); |
---|
108 | _end = .; |
---|
109 | |
---|
110 | _HeapStart = .; |
---|
111 | __HeapStart = .; |
---|
112 | . += HeapSize; /* XXX -- Old gld can't handle this */ |
---|
113 | . += StackSize; /* XXX -- Old gld can't handle this */ |
---|
114 | /* . += 0x10000; */ /* HeapSize for old gld */ |
---|
115 | /* . += 0x1000; */ /* StackSize for old gld */ |
---|
116 | . = ALIGN (16); |
---|
117 | stack_init = .; |
---|
118 | clear_end = .; |
---|
119 | |
---|
120 | _WorkspaceBase = .; |
---|
121 | __WorkspaceBase = .; |
---|
122 | } >ram |
---|
123 | |
---|
124 | /* |
---|
125 | * On-chip memory/peripherals |
---|
126 | */ |
---|
127 | dpram : { |
---|
128 | m360 = .; |
---|
129 | _m360 = .; |
---|
130 | . += (8 * 1024); |
---|
131 | |
---|
132 | } >dpram |
---|
133 | } |
---|