1 | /* |
---|
2 | * linkcmds |
---|
3 | */ |
---|
4 | |
---|
5 | /* |
---|
6 | * Declare some sizes. |
---|
7 | */ |
---|
8 | RamBase = DEFINED(RamBase) ? RamBase : 0x80000000; |
---|
9 | RamSize = DEFINED(RamSize) ? RamSize : 4M; |
---|
10 | HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0; |
---|
11 | |
---|
12 | ENTRY(start) |
---|
13 | STARTUP(start.o) |
---|
14 | |
---|
15 | SECTIONS |
---|
16 | { |
---|
17 | /* 0x80000000 - 0x8001FFFF used by PMON (with 0x80010000 - 0x8001FFFF as heap for symbol storage) |
---|
18 | 0x80020000 - 0x8002FFFF reserved for shared memory |
---|
19 | 0x80030000 beginning of text (code) section |
---|
20 | */ |
---|
21 | .text 0x80030000 : |
---|
22 | { |
---|
23 | _ftext = . ; |
---|
24 | eprol = .; |
---|
25 | *(.text) |
---|
26 | *(.text.*) |
---|
27 | *(.gnu.linkonce.t*) |
---|
28 | *(.mips16.fn.*) |
---|
29 | *(.mips16.call.*) |
---|
30 | PROVIDE (__runtime_reloc_start = .); |
---|
31 | *(.rel.sdata) |
---|
32 | PROVIDE (__runtime_reloc_stop = .); |
---|
33 | |
---|
34 | /* |
---|
35 | * Special FreeBSD sysctl sections. |
---|
36 | */ |
---|
37 | . = ALIGN (16); |
---|
38 | __start_set_sysctl_set = .; |
---|
39 | *(set_sysctl_*); |
---|
40 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
41 | *(set_domain_*); |
---|
42 | *(set_pseudo_*); |
---|
43 | |
---|
44 | *(.gcc_except_table*) |
---|
45 | *(.eh_frame_hdr) |
---|
46 | *(.eh_frame) |
---|
47 | } |
---|
48 | |
---|
49 | .init : |
---|
50 | { |
---|
51 | KEEP(*crti.o(.init)) |
---|
52 | KEEP(*(.init)) |
---|
53 | KEEP(*crtn.o(.init)) |
---|
54 | } |
---|
55 | |
---|
56 | .fini : |
---|
57 | { |
---|
58 | KEEP(*crti.o(.fini)) |
---|
59 | KEEP(*(.fini)) |
---|
60 | KEEP(*crtn.o(.fini)) |
---|
61 | } |
---|
62 | |
---|
63 | .ctors : |
---|
64 | { |
---|
65 | /* gcc uses crtbegin.o to find the start of |
---|
66 | the constructors, so we make sure it is |
---|
67 | first. Because this is a wildcard, it |
---|
68 | doesn't matter if the user does not |
---|
69 | actually link against crtbegin.o; the |
---|
70 | linker won't look for a file to match a |
---|
71 | wildcard. The wildcard also means that it |
---|
72 | doesn't matter which directory crtbegin.o |
---|
73 | is in. */ |
---|
74 | |
---|
75 | KEEP (*crtbegin.o(.ctors)) |
---|
76 | |
---|
77 | /* We don't want to include the .ctor section from |
---|
78 | from the crtend.o file until after the sorted ctors. |
---|
79 | The .ctor section from the crtend file contains the |
---|
80 | end of ctors marker and it must be last */ |
---|
81 | |
---|
82 | KEEP (*(EXCLUDE_FILE (*crtend.o) .ctors)) |
---|
83 | KEEP (*(SORT(.ctors.*))) |
---|
84 | KEEP (*(.ctors)) |
---|
85 | } |
---|
86 | |
---|
87 | .dtors : |
---|
88 | { |
---|
89 | KEEP (*crtbegin.o(.dtors)) |
---|
90 | KEEP (*(EXCLUDE_FILE (*crtend.o) .dtors)) |
---|
91 | KEEP (*(SORT(.dtors.*))) |
---|
92 | KEEP (*(.dtors)) |
---|
93 | |
---|
94 | etext = .; |
---|
95 | _etext = .; |
---|
96 | } |
---|
97 | |
---|
98 | .rdata : { |
---|
99 | *(.rdata) |
---|
100 | *(.rodata) |
---|
101 | *(.rodata.*) |
---|
102 | KEEP (*(SORT(.rtemsroset.*))) |
---|
103 | *(.gnu.linkonce.r*) |
---|
104 | } |
---|
105 | |
---|
106 | .tdata : { |
---|
107 | _TLS_Data_begin = .; |
---|
108 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
109 | _TLS_Data_end = .; |
---|
110 | } |
---|
111 | |
---|
112 | .tbss : { |
---|
113 | _TLS_BSS_begin = .; |
---|
114 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
115 | _TLS_BSS_end = .; |
---|
116 | } |
---|
117 | |
---|
118 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
119 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
120 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
121 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
122 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
123 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
124 | |
---|
125 | _fdata = ALIGN(16); |
---|
126 | |
---|
127 | .data : { |
---|
128 | *(.data) |
---|
129 | *(.data.*) |
---|
130 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
131 | *(.gnu.linkonce.d*) |
---|
132 | SORT(CONSTRUCTORS) |
---|
133 | } |
---|
134 | . = ALIGN(8); |
---|
135 | |
---|
136 | .jcr : { |
---|
137 | KEEP (*(.jcr)) |
---|
138 | } |
---|
139 | |
---|
140 | _gp = ALIGN(16) + 0x8000; |
---|
141 | __global = _gp; |
---|
142 | |
---|
143 | .sdata : { |
---|
144 | *(.sdata) |
---|
145 | *(.sdata.*) |
---|
146 | *(.gnu.linkonce.s*) |
---|
147 | } |
---|
148 | .lit8 : { |
---|
149 | *(.lit8) |
---|
150 | } |
---|
151 | .lit4 : { |
---|
152 | *(.lit4) |
---|
153 | } |
---|
154 | |
---|
155 | edata = .; |
---|
156 | _edata = .; |
---|
157 | _fbss = .; |
---|
158 | |
---|
159 | .sbss : { |
---|
160 | *(.sbss) |
---|
161 | *(.scommon) |
---|
162 | } |
---|
163 | .bss : { |
---|
164 | _bss_start = . ; |
---|
165 | *(.bss) |
---|
166 | *(COMMON) |
---|
167 | . = ALIGN (64); |
---|
168 | end = .; |
---|
169 | _end = .; |
---|
170 | } |
---|
171 | |
---|
172 | .rtemsstack (NOLOAD) : { |
---|
173 | *(SORT(.rtemsstack.*)) |
---|
174 | WorkAreaBase = .; |
---|
175 | } |
---|
176 | |
---|
177 | /* Debug sections. These should never be loadable, but they must have |
---|
178 | zero addresses for the debuggers to work correctly. */ |
---|
179 | .line 0 : { *(.line) } |
---|
180 | .debug 0 : { *(.debug) } |
---|
181 | .debug_sfnames 0 : { *(.debug_sfnames) } |
---|
182 | .debug_srcinfo 0 : { *(.debug_srcinfo) } |
---|
183 | .debug_macinfo 0 : { *(.debug_macinfo) } |
---|
184 | .debug_pubnames 0 : { *(.debug_pubnames) } |
---|
185 | .debug_aranges 0 : { *(.debug_aranges) } |
---|
186 | } |
---|