1 | /* linkcmds |
---|
2 | */ |
---|
3 | |
---|
4 | /* |
---|
5 | * For alignment, SPARC v9 specifies that instructions are 4-byte aligned, |
---|
6 | * and the worst-case alignment requirements for data are for quad-word |
---|
7 | * accesses, which must be 16-byte aligned. |
---|
8 | */ |
---|
9 | |
---|
10 | /* |
---|
11 | * Declare some sizes. |
---|
12 | */ |
---|
13 | RamBase = DEFINED(RamBase) ? RamBase : 0x0; |
---|
14 | RamSize = DEFINED(RamSize) ? RamSize : 4M; |
---|
15 | RamEnd = RamBase + RamSize; |
---|
16 | HeapSize = DEFINED(HeapSize) ? HeapSize : 1M; |
---|
17 | |
---|
18 | RAM_END = RamBase + RamSize; |
---|
19 | |
---|
20 | /* Default linker script, for normal executables */ |
---|
21 | OUTPUT_FORMAT("elf64-sparc") |
---|
22 | ENTRY(_start) |
---|
23 | STARTUP(start.o) |
---|
24 | |
---|
25 | MEMORY |
---|
26 | { |
---|
27 | ram : ORIGIN = 0x0, LENGTH = 12M |
---|
28 | } |
---|
29 | |
---|
30 | SECTIONS |
---|
31 | { |
---|
32 | /* Read-only sections, merged into text segment: */ |
---|
33 | .hash : { *(.hash) } |
---|
34 | .dynsym : { *(.dynsym) } |
---|
35 | .dynstr : { *(.dynstr) } |
---|
36 | .gnu.version : { *(.gnu.version) } |
---|
37 | .gnu.version_d : { *(.gnu.version_d) } |
---|
38 | .gnu.version_r : { *(.gnu.version_r) } |
---|
39 | /* Internal text space or external memory */ |
---|
40 | .text 0x4000 : AT (0x4000) |
---|
41 | { |
---|
42 | *(BOOTSTRAP); |
---|
43 | *(.text*) |
---|
44 | |
---|
45 | KEEP (*(.init)) |
---|
46 | KEEP (*(.fini)) |
---|
47 | |
---|
48 | /* |
---|
49 | * Special FreeBSD sysctl sections. |
---|
50 | */ |
---|
51 | . = ALIGN (16); |
---|
52 | __start_set_sysctl_set = .; |
---|
53 | *(set_sysctl_*); |
---|
54 | __stop_set_sysctl_set = ABSOLUTE(.); |
---|
55 | *(set_domain_*); |
---|
56 | *(set_pseudo_*); |
---|
57 | |
---|
58 | *(.eh_frame) |
---|
59 | . = ALIGN (16); |
---|
60 | |
---|
61 | *(.gnu.linkonce.t*) |
---|
62 | *(.gcc_except_table*) |
---|
63 | |
---|
64 | /* |
---|
65 | * C++ constructors |
---|
66 | */ |
---|
67 | /* gcc uses crtbegin.o to find the start of |
---|
68 | the constructors, so we make sure it is |
---|
69 | first. Because this is a wildcard, it |
---|
70 | doesn't matter if the user does not |
---|
71 | actually link against crtbegin.o; the |
---|
72 | linker won't look for a file to match a |
---|
73 | wildcard. The wildcard also means that it |
---|
74 | doesn't matter which directory crtbegin.o |
---|
75 | is in. */ |
---|
76 | KEEP (*crtbegin.o(.ctors)) |
---|
77 | KEEP (*crtbegin?.o(.ctors)) |
---|
78 | /* We don't want to include the .ctor section from |
---|
79 | the crtend.o file until after the sorted ctors. |
---|
80 | The .ctor section from the crtend file contains the |
---|
81 | end of ctors marker and it must be last */ |
---|
82 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .ctors)) |
---|
83 | KEEP (*(SORT(.ctors.*))) |
---|
84 | KEEP (*(.ctors)) |
---|
85 | KEEP (*crtbegin.o(.dtors)) |
---|
86 | KEEP (*crtbegin?.o(.dtors)) |
---|
87 | KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o ) .dtors)) |
---|
88 | KEEP (*(SORT(.dtors.*))) |
---|
89 | KEEP (*(.dtors)) |
---|
90 | |
---|
91 | _rodata_start = . ; |
---|
92 | *(.rodata*) |
---|
93 | KEEP (*(SORT(.rtemsroset.*))) |
---|
94 | *(.gnu.linkonce.r*) |
---|
95 | _erodata = ALIGN( 0x10 ) ; |
---|
96 | |
---|
97 | *(.lit) |
---|
98 | *(.shdata) |
---|
99 | |
---|
100 | . = ALIGN (16); |
---|
101 | _endtext = . ; |
---|
102 | _etext = . ; |
---|
103 | } > ram |
---|
104 | |
---|
105 | .tdata : AT (ADDR (.text) + SIZEOF (.text)) { |
---|
106 | _TLS_Data_begin = .; |
---|
107 | *(.tdata .tdata.* .gnu.linkonce.td.*) |
---|
108 | _TLS_Data_end = .; |
---|
109 | } > ram |
---|
110 | .tbss : AT (ADDR (.tdata) + SIZEOF (.tdata)) { |
---|
111 | _TLS_BSS_begin = .; |
---|
112 | *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon) |
---|
113 | _TLS_BSS_end = .; |
---|
114 | } > ram |
---|
115 | _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin; |
---|
116 | _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin; |
---|
117 | _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin; |
---|
118 | _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin; |
---|
119 | _TLS_Size = _TLS_BSS_end - _TLS_Data_begin; |
---|
120 | _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss)); |
---|
121 | |
---|
122 | .rela.dyn : AT (ADDR (.tbss) + SIZEOF (.tbss)) |
---|
123 | { |
---|
124 | *(.rela.init) |
---|
125 | *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*) |
---|
126 | *(.rela.fini) |
---|
127 | *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*) |
---|
128 | *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*) |
---|
129 | *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*) |
---|
130 | *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*) |
---|
131 | *(.rela.ctors) |
---|
132 | *(.rela.dtors) |
---|
133 | *(.rela.got) |
---|
134 | *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*) |
---|
135 | *(.rela.rtemsroset*) |
---|
136 | *(.rela.rtemsrwset*) |
---|
137 | } > ram |
---|
138 | |
---|
139 | .data : AT (ADDR (.rela.dyn) + SIZEOF (.rela.dyn)) |
---|
140 | { |
---|
141 | PROVIDE (__data_start = .) ; |
---|
142 | data_start = . ; |
---|
143 | _data_start = . ; |
---|
144 | *(.data) |
---|
145 | *(.data*) |
---|
146 | KEEP (*(SORT(.rtemsrwset.*))) |
---|
147 | *(.rodata) /* We need to include .rodata here if gcc is used */ |
---|
148 | *(.rodata*) /* with -fdata-sections. */ |
---|
149 | *(.gnu.linkonce.d*) |
---|
150 | . = ALIGN(2); |
---|
151 | edata = . ; |
---|
152 | _edata = . ; |
---|
153 | PROVIDE (__data_end = .) ; |
---|
154 | } > ram |
---|
155 | |
---|
156 | /* XXX |
---|
157 | __data_load_start = LOADADDR(.data); |
---|
158 | __data_load_end = __data_load_start + SIZEOF(.data); |
---|
159 | */ |
---|
160 | . = ALIGN (16); |
---|
161 | .dynamic : { *(.dynamic) } >ram |
---|
162 | .jcr : { *(.jcr) } > ram |
---|
163 | .got : { *(.got) } >ram |
---|
164 | .plt : { *(.plt) } >ram |
---|
165 | .dynrel : { *(.dynrel) } >ram |
---|
166 | .shbss : { *(.shbss) } > ram |
---|
167 | .bss : |
---|
168 | { |
---|
169 | FILL(0x00000000); |
---|
170 | . = ALIGN(16); |
---|
171 | __bss_start = ALIGN(0x8); |
---|
172 | bss_start = .; |
---|
173 | bss_start = .; |
---|
174 | *(.bss .bss* .gnu.linkonce.b*) |
---|
175 | *(COMMON) |
---|
176 | . = ALIGN (16); |
---|
177 | end = .; |
---|
178 | _end = .; |
---|
179 | __end = .; |
---|
180 | } > ram |
---|
181 | |
---|
182 | .noinit (NOLOAD) : { |
---|
183 | *(.noinit*) |
---|
184 | } > ram |
---|
185 | |
---|
186 | .rtemsstack (NOLOAD) : { |
---|
187 | *(SORT(.rtemsstack.*)) |
---|
188 | PROVIDE (WorkAreaBase = .); |
---|
189 | } > ram |
---|
190 | |
---|
191 | .heap : { |
---|
192 | . += HeapSize; |
---|
193 | PROVIDE (HeapBase = .); |
---|
194 | . += HeapSize; |
---|
195 | } > ram |
---|
196 | } |
---|
197 | |
---|
198 | |
---|