1 | /* linkcmds |
---|
2 | * |
---|
3 | * $Id$ |
---|
4 | */ |
---|
5 | |
---|
6 | OUTPUT_ARCH(m68k) |
---|
7 | STARTUP(except_vect_332_ROM.o) |
---|
8 | __DYNAMIC = 0; |
---|
9 | |
---|
10 | /* |
---|
11 | * ROM: |
---|
12 | * +--------------------+ <- low memory |
---|
13 | * | .text | |
---|
14 | * | etext | |
---|
15 | * | ctor list | the ctor and dtor lists are for |
---|
16 | * | dtor list | C++ support |
---|
17 | * | _endtext | |
---|
18 | * | temporary .data | .data is moved to RAM by crt0 |
---|
19 | * | | |
---|
20 | * +--------------------+ <- high memory |
---|
21 | * |
---|
22 | * |
---|
23 | * RAM: |
---|
24 | * +--------------------+ <- low memory |
---|
25 | * | .data | initialized data goes here |
---|
26 | * | _sdata | |
---|
27 | * | _edata | |
---|
28 | * +--------------------+ |
---|
29 | * | .bss | |
---|
30 | * | __bss_start | start of bss, cleared by crt0 |
---|
31 | * | _end | start of heap, used by sbrk() |
---|
32 | * +--------------------+ |
---|
33 | * | heap space | |
---|
34 | * | _ENDHEAP | |
---|
35 | * | stack space | |
---|
36 | * | __stack | top of stack |
---|
37 | * +--------------------+ <- high memory |
---|
38 | */ |
---|
39 | |
---|
40 | MEMORY |
---|
41 | { |
---|
42 | rom : ORIGIN = 0x90000, LENGTH = 0x70000 |
---|
43 | ram : ORIGIN = 0x03000, LENGTH = 0x7d000 |
---|
44 | } |
---|
45 | |
---|
46 | _RamBase = DEFINED(_RamBase) ? _RamBase : 0x003000; |
---|
47 | _RamSize = DEFINED(_RamSize) ? _RamSize : 0x7d000; |
---|
48 | _RamEnd = _RamBase + _RamSize; |
---|
49 | |
---|
50 | __end_of_ram = 0x080000; |
---|
51 | _copy_data_from_rom = 1; |
---|
52 | _HeapSize = DEFINED(_HeapSize) ? _HeapSize : 0x10000; |
---|
53 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x1000; |
---|
54 | |
---|
55 | /* |
---|
56 | * |
---|
57 | */ |
---|
58 | SECTIONS |
---|
59 | { |
---|
60 | .text : |
---|
61 | { |
---|
62 | . = .; |
---|
63 | CREATE_OBJECT_SYMBOLS |
---|
64 | text_start = .; |
---|
65 | _text_start = .; |
---|
66 | *(.text) |
---|
67 | . = ALIGN (16); |
---|
68 | |
---|
69 | |
---|
70 | /* |
---|
71 | * Initialization and finalization code. |
---|
72 | * |
---|
73 | * Various files can provide initialization and finalization |
---|
74 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
75 | * body of these functions are in .init and .fini sections. We |
---|
76 | * accumulate the bodies here, and prepend function prologues |
---|
77 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
78 | * be linked first; crtn.o must be linked last. Because these |
---|
79 | * are wildcards, it doesn't matter if the user does not |
---|
80 | * actually link against crti.o and crtn.o; the linker won't |
---|
81 | * look for a file to match a wildcard. The wildcard also |
---|
82 | * means that it doesn't matter which directory crti.o and |
---|
83 | * crtn.o are in. |
---|
84 | */ |
---|
85 | PROVIDE (_init = .); |
---|
86 | *crti.o(.init) |
---|
87 | *(.init) |
---|
88 | *crtn.o(.init) |
---|
89 | PROVIDE (_fini = .); |
---|
90 | *crti.o(.fini) |
---|
91 | *(.fini) |
---|
92 | *crtn.o(.fini) |
---|
93 | |
---|
94 | *(.eh_fram) |
---|
95 | . = ALIGN (16); |
---|
96 | |
---|
97 | /* |
---|
98 | * Read-only data |
---|
99 | */ |
---|
100 | . = ALIGN (16); |
---|
101 | _rodata_start = . ; |
---|
102 | *(.rodata) |
---|
103 | *(.gnu.linkonce.r*) |
---|
104 | |
---|
105 | etext = ALIGN(0x10); |
---|
106 | __CTOR_LIST__ = .; |
---|
107 | LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) |
---|
108 | *(.ctors) |
---|
109 | LONG(0) |
---|
110 | __CTOR_END__ = .; |
---|
111 | __DTOR_LIST__ = .; |
---|
112 | LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) |
---|
113 | *(.dtors) |
---|
114 | LONG(0) |
---|
115 | __DTOR_END__ = .; |
---|
116 | *(.lit) |
---|
117 | *(.shdata) |
---|
118 | _etext = .; |
---|
119 | _endtext = .; |
---|
120 | } > rom |
---|
121 | .gcc_exc : |
---|
122 | AT ( ADDR(.text) + SIZEOF( .text ) ) |
---|
123 | { |
---|
124 | *(.gcc_exc) |
---|
125 | } > ram |
---|
126 | .data : |
---|
127 | { |
---|
128 | data_start = .; |
---|
129 | _data_start = .; |
---|
130 | _copy_start = .; |
---|
131 | _sdata = . ; |
---|
132 | *(.data) |
---|
133 | CONSTRUCTORS |
---|
134 | edata = ALIGN(0x10); |
---|
135 | _edata = .; |
---|
136 | } > ram |
---|
137 | .shbss : |
---|
138 | { |
---|
139 | *(.shbss) |
---|
140 | } > ram |
---|
141 | .bss : |
---|
142 | { |
---|
143 | __bss_start = ALIGN(0x8); |
---|
144 | bss_start = .; |
---|
145 | _bss_start = .; |
---|
146 | _clear_start = .; |
---|
147 | *(.bss) |
---|
148 | *(COMMON) |
---|
149 | end = .; |
---|
150 | _end = ALIGN(0x8); |
---|
151 | __end = ALIGN(0x8); |
---|
152 | |
---|
153 | _WorkspaceBase = . + _StackSize; |
---|
154 | } > ram |
---|
155 | .stab . (NOLOAD) : |
---|
156 | { |
---|
157 | [ .stab ] |
---|
158 | } |
---|
159 | .stabstr . (NOLOAD) : |
---|
160 | { |
---|
161 | [ .stabstr ] |
---|
162 | } |
---|
163 | } |
---|