1 | /* linkcmds |
---|
2 | */ |
---|
3 | |
---|
4 | OUTPUT_ARCH(m68k) |
---|
5 | __DYNAMIC = 0; |
---|
6 | |
---|
7 | /* |
---|
8 | * The memory map looks like this: |
---|
9 | * +--------------------+ <- low memory |
---|
10 | * | .text | |
---|
11 | * | etext | |
---|
12 | * | ctor list | the ctor and dtor lists are for |
---|
13 | * | dtor list | C++ support |
---|
14 | * | _endtext | |
---|
15 | * +--------------------+ |
---|
16 | * | .data | initialized data goes here |
---|
17 | * | _sdata | |
---|
18 | * | _edata | |
---|
19 | * +--------------------+ |
---|
20 | * | .bss | |
---|
21 | * | _clear_start| start of bss, cleared by crt0 |
---|
22 | * | _end | start of heap, used by sbrk() |
---|
23 | * +--------------------+ |
---|
24 | * | heap space | |
---|
25 | * | _ENDHEAP | |
---|
26 | * | stack space | |
---|
27 | * | __stack | top of stack |
---|
28 | * +--------------------+ <- high memory |
---|
29 | */ |
---|
30 | |
---|
31 | /* |
---|
32 | * Declare some sizes. |
---|
33 | */ |
---|
34 | RamBase = DEFINED(RamBase) ? RamBase : 0x10000; |
---|
35 | RamSize = DEFINED(RamSize) ? RamSize : 0x70000; |
---|
36 | _RamEnd = RamBase + RamSize; |
---|
37 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
38 | _StackSize = DEFINED(_StackSize) ? _StackSize : 0x2000; |
---|
39 | |
---|
40 | MEMORY |
---|
41 | { |
---|
42 | ram : ORIGIN = 0x10000, LENGTH = 0x70000 |
---|
43 | } |
---|
44 | |
---|
45 | _copy_data_from_rom = 0; |
---|
46 | |
---|
47 | /* |
---|
48 | * stick everything in ram (of course) |
---|
49 | */ |
---|
50 | SECTIONS |
---|
51 | { |
---|
52 | ram : { |
---|
53 | . = .; |
---|
54 | } >ram |
---|
55 | |
---|
56 | /* |
---|
57 | * Text, data and bss segments |
---|
58 | */ |
---|
59 | .text : { |
---|
60 | *(.text*) |
---|
61 | |
---|
62 | /* |
---|
63 | * C++ constructors/destructors |
---|
64 | */ |
---|
65 | *(.gnu.linkonce.t.*) |
---|
66 | |
---|
67 | /* |
---|
68 | * Initialization and finalization code. |
---|
69 | * |
---|
70 | * Various files can provide initialization and finalization |
---|
71 | * functions. crtbegin.o and crtend.o are two instances. The |
---|
72 | * body of these functions are in .init and .fini sections. We |
---|
73 | * accumulate the bodies here, and prepend function prologues |
---|
74 | * from crti.o and function epilogues from crtn.o. crti.o must |
---|
75 | * be linked first; crtn.o must be linked last. Because these |
---|
76 | * are wildcards, it doesn't matter if the user does not |
---|
77 | * actually link against crti.o and crtn.o; the linker won't |
---|
78 | * look for a file to match a wildcard. The wildcard also |
---|
79 | * means that it doesn't matter which directory crti.o and |
---|
80 | * crtn.o are in. |
---|
81 | */ |
---|
82 | PROVIDE (_init = .); |
---|
83 | *crti.o(.init) |
---|
84 | *(.init) |
---|
85 | *crtn.o(.init) |
---|
86 | PROVIDE (_fini = .); |
---|
87 | *crti.o(.fini) |
---|
88 | *(.fini) |
---|
89 | *crtn.o(.fini) |
---|
90 | |
---|
91 | /* |
---|
92 | * Special FreeBSD sysctl sections. |
---|
93 | */ |
---|
94 | . = ALIGN (16); |
---|
95 | __start_set_sysctl_set = .; |
---|
96 | *(set_sysctl_*); |
---|
97 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
98 | *(set_domain_*); |
---|
99 | *(set_pseudo_*); |
---|
100 | |
---|
101 | /* |
---|
102 | * C++ constructors/destructors |
---|
103 | * |
---|
104 | * gcc uses crtbegin.o to find the start of the constructors |
---|
105 | * and destructors so we make sure it is first. Because this |
---|
106 | * is a wildcard, it doesn't matter if the user does not |
---|
107 | * actually link against crtbegin.o; the linker won't look for |
---|
108 | * a file to match a wildcard. The wildcard also means that |
---|
109 | * it doesn't matter which directory crtbegin.o is in. The |
---|
110 | * constructor and destructor list are terminated in |
---|
111 | * crtend.o. The same comments apply to it. |
---|
112 | */ |
---|
113 | . = ALIGN (16); |
---|
114 | *crtbegin.o(.ctors) |
---|
115 | *(.ctors) |
---|
116 | *crtend.o(.ctors) |
---|
117 | *crtbegin.o(.dtors) |
---|
118 | *(.dtors) |
---|
119 | *crtend.o(.dtors) |
---|
120 | |
---|
121 | /* |
---|
122 | * Exception frame info |
---|
123 | */ |
---|
124 | . = ALIGN (16); |
---|
125 | *(.eh_frame) |
---|
126 | |
---|
127 | /* |
---|
128 | * Read-only data |
---|
129 | */ |
---|
130 | . = ALIGN (16); |
---|
131 | _rodata_start = .; |
---|
132 | *(.rodata*) |
---|
133 | *(.gnu.linkonce.r*) |
---|
134 | |
---|
135 | . = ALIGN (16); |
---|
136 | PROVIDE (_etext = .); |
---|
137 | } >ram |
---|
138 | .data : { |
---|
139 | PROVIDE (_copy_start = .); |
---|
140 | *(.data*) |
---|
141 | *(.gnu.linkonce.d*) |
---|
142 | *(.gcc_except_table*) |
---|
143 | *(.jcr) |
---|
144 | . = ALIGN (16); |
---|
145 | PROVIDE (_edata = .); |
---|
146 | PROVIDE (_copy_end = .); |
---|
147 | } >ram |
---|
148 | .bss : { |
---|
149 | _clear_start = .; |
---|
150 | *(.dynbss) |
---|
151 | *(.bss* .gnu.linkonce.b.*) |
---|
152 | *(COMMON) |
---|
153 | . = ALIGN (16); |
---|
154 | PROVIDE (end = .); |
---|
155 | . += _StackSize; |
---|
156 | . = ALIGN (16); |
---|
157 | _stack_init = .; |
---|
158 | _clear_end = .; |
---|
159 | |
---|
160 | WorkAreaBase = .; |
---|
161 | } >ram |
---|
162 | } |
---|