source: rtems/bsps/powerpc/mpc8260ads/start/linkcmds @ 86abbb6e

5
Last change on this file since 86abbb6e was 86abbb6e, checked in by Sebastian Huber <sebastian.huber@…>, on 12/19/19 at 11:05:45

bsps/powerpc: Support constructors with priority

Close #3339.

  • Property mode set to 100644
File size: 8.7 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the MPC8260ADS Board
4 */
5
6OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc",
7              "elf32-powerpc")
8OUTPUT_ARCH(powerpc)
9
10ENTRY(start)
11STARTUP(start.o)
12EXTERN(__vectors)
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 */
20RamBase     = DEFINED(RamBase) ? RamBase : 0x0;
21RamSize     = DEFINED(RamSize) ? RamDiskSize : 0x0800000; /* 8M program ram */
22HeapSize    = DEFINED(HeapSize) ? HeapSize : 0x0;
23RamDiskBase = DEFINED(RamDiskBase) ? RamDiskBase : 0x0800000;
24RamDiskSize = DEFINED(RamDiskSize) ? RamDiskSize : 0x0800000; /* 8M ram disk */
25
26MEMORY
27{
28  ram : org = 0x0, l = 8M
29  ramdisk : org = 0x0800000, l = 8M
30  dpram : org = 0x04700000, l = 128K
31  flash : org = 0xff800000, l = 8M
32}
33
34
35SECTIONS
36{
37    /*
38     * The stack will live in this area - between the vectors and
39     * the text section.
40     */
41
42    .text 0x10000:
43    {
44    _textbase = .;
45
46
47    text.start = .;
48
49    /* Entry point is the .entry section */
50    *(.entry)
51    *(.entry2)
52
53    /* Actual Code */
54    *(.text*)
55
56
57    *(.rodata*)
58    *(.rodata1)
59
60
61    /*
62     * Special FreeBSD sysctl sections.
63     */
64    . = ALIGN (16);
65    __start_set_sysctl_set = .;
66    *(set_sysctl_*);
67    __stop_set_sysctl_set = ABSOLUTE(.);
68    *(set_domain_*);
69    *(set_pseudo_*);
70
71    /* C++ constructors/destructors */
72    *(.gnu.linkonce.t*)
73
74    /*  Initialization and finalization code.
75     *
76     *  Various files can provide initialization and finalization functions.
77     *  The bodies of these functions are in .init and .fini sections. We
78     *  accumulate the bodies here, and prepend function prologues from
79     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
80     *  first; ecrtn.o must be linked last. Because these are wildcards, it
81     *  doesn't matter if the user does not actually link against ecrti.o and
82     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
83     *  wildcard also means that it doesn't matter which directory ecrti.o
84     *  and ecrtn.o are in.
85     */
86    PROVIDE (_init = .);
87    *ecrti.o(.init)
88    *(.init)
89    *ecrtn.o(.init)
90
91    PROVIDE (_fini = .);
92    *ecrti.o(.fini)
93    *(.fini)
94    *ecrtn.o(.init)
95
96    KEEP (*ecrti.o(.ctors))
97    KEEP (*crtbegin.o(.ctors))
98    KEEP (*crtbegin?.o(.ctors))
99    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors))
100    KEEP (*(SORT(.ctors.*)))
101    KEEP (*(.ctors))
102    KEEP (*ecrti.o(.dtors))
103    KEEP (*crtbegin.o(.dtors))
104    KEEP (*crtbegin?.o(.dtors))
105    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors))
106    KEEP (*(SORT(.dtors.*)))
107    KEEP (*(.dtors))
108
109    /* Exception frame info */
110    *(.eh_frame)
111
112    /* Miscellaneous read-only data */
113    _rodata_start = . ;
114    *(.gnu.linkonce.r*)
115    *(.lit)
116    *(.shdata)
117    *(.rodata)
118    *(.rodata1)
119    KEEP (*(SORT(.rtemsroset.*)))
120    *(.descriptors)
121    *(rom_ver)
122    _erodata = .;
123
124
125    /* Various possible names for the end of the .text section */
126    etext = ALIGN(0x10);
127    _etext = .;
128    _endtext = .;
129    text.end = .;
130    PROVIDE (etext = .);
131    PROVIDE (__etext = .);
132
133    } > ram
134
135  .tdata : {
136    _TLS_Data_begin = .;
137    *(.tdata .tdata.* .gnu.linkonce.td.*)
138    _TLS_Data_end = .;
139  } >ram
140
141  .tbss : {
142    _TLS_BSS_begin = .;
143    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
144    _TLS_BSS_end = .;
145  } >ram
146
147  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
148  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
149  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
150  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
151  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
152  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
153
154
155  .rel.dyn        :
156    {
157      *(.rel.init)
158      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
159      *(.rel.fini)
160      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
161      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
162      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
163      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
164      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
165      *(.rel.ctors)
166      *(.rel.dtors)
167      *(.rel.got)
168      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
169      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
170      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
171      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
172      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
173    } >ram
174  .rela.dyn       :
175    {
176      *(.rela.init)
177      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
178      *(.rela.fini)
179      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
180      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
181      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
182      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
183      *(.rela.ctors)
184      *(.rela.dtors)
185      *(.rela.got)
186      *(.rela.got1)
187      *(.rela.got2)
188      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
189      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
190      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
191      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
192      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
193    } >ram
194  .rel.plt        : { *(.rel.plt) }
195  .rela.plt       : { *(.rela.plt) }
196
197    PROVIDE (__EXCEPT_START__ = .);
198    .gcc_except_table   : { *(.gcc_except_table*) } >ram
199    PROVIDE (__EXCEPT_END__ = .);
200    __GOT_START__ = .;
201    .got :
202    {
203      s.got = .;
204      *(.got.plt) *(.got)
205    } > ram
206    __GOT_END__ = .;
207
208    .got1                 : { *(.got1)          } >ram
209    PROVIDE (__GOT2_START__ = .);
210    PROVIDE (_GOT2_START_ = .);
211    .got2                 :  { *(.got2)         } >ram
212    PROVIDE (__GOT2_END__ = .);
213    PROVIDE (_GOT2_END_ = .);
214
215    PROVIDE (__FIXUP_START__ = .);
216    PROVIDE (_FIXUP_START_ = .);
217    .fixup        : { *(.fixup)         } >ram
218    PROVIDE (_FIXUP_END_ = .);
219    PROVIDE (__FIXUP_END__ = .);
220
221    .sdata : {
222      bsp_section_sdata_begin = .;
223      PROVIDE (_SDA_BASE_ = 32768);
224      *(.sdata .sdata.* .gnu.linkonce.s.*)
225      bsp_section_sdata_end = .;
226  } > ram
227
228    .sbss : {
229      __bss_start = .;
230      bsp_section_sbss_begin = .;
231
232      PROVIDE (__sbss_start = .); PROVIDE (___sbss_start = .);
233      *(.scommon)
234      *(.dynsbss)
235      *(.sbss .sbss.* .gnu.linkonce.sb.*)
236      PROVIDE (__sbss_end = .); PROVIDE (___sbss_end = .);
237      bsp_section_sbss_end = .;
238      bsp_section_sdata_libdl_begin = .;
239      . = DEFINED(bsp_section_small_data_area_size) ?
240              bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
241      bsp_section_sdata_libdl_end = .;
242    } > ram
243
244    .sdata2 : {
245      PROVIDE (_SDA2_BASE_ = 32768);
246
247      *(.sdata2 .sdata2.* .gnu.linkonce.s2.*)
248    } > ram =0
249
250    .sbss2 : {
251      *(.sbss2 .sbss2.* .gnu.linkonce.sb2.*)
252    } > ram =0
253
254    .bss :
255    {
256      bss.start = .;
257      *(.bss .bss* .gnu.linkonce.b*)
258      . = ALIGN(4);
259      bss.end = .;
260    } > ram
261
262    /* R/W Data */
263    .data ( . ) :
264    {
265      . = ALIGN (4);
266
267      data.start = .;
268
269      *(.data)
270      *(.data1)
271      *(.data.* .gnu.linkonce.d.*)
272      KEEP (*(SORT(.rtemsrwset.*)))
273      PROVIDE (__SDATA_START__ = .);
274      *(.sdata .sdata.* .gnu.linkonce.s.*)
275      data.end = .;
276    } > ram
277
278    data.size = data.end - data.start;
279    bss.size = bss.end - bss.start;
280    text.size = text.end - text.start;
281
282    PROVIDE(_end = data.end);
283
284    .gzipmalloc : {
285        . = ALIGN (16);
286        _startmalloc = .;
287     } >ram
288
289    clear_end = .;
290
291    .rtemsstack (NOLOAD) : {
292        *(SORT(.rtemsstack.*))
293    } >ram
294
295    WorkAreaBase = .;
296
297    /* Sections for compressed .text and .data         */
298    /* after the .datarom section is an int specifying */
299    /* the length of the following compressed image    */
300    /* Executes once then could get overwritten        */
301    .textrom 0x100000 :
302    {
303        *(.textrom)
304        _endloader = .;
305    } > ram
306
307    .datarom :
308    {
309        _dr_start = .;
310        *(.datarom)
311        _dr_end = .;
312    } > ram
313    dr_len = _dr_end - _dr_start;
314
315    .dpram :
316    {
317      m8260 = .;
318      _m8260 = .;
319      . += (128 * 1024);
320     } > dpram
321
322
323     /* the reset vector is at 0xfff00000 which is */
324     /* located at offset 0x400000 from the base   */
325     /* of flash                                   */
326    .bootrom 0xFFF00000 :
327    {
328      *(.bootrom)
329      _endboot = .;
330    } > flash
331
332
333    .line 0 : { *(.line) }
334    .debug 0 : { *(.debug) }
335    .debug_sfnames 0 : { *(.debug_sfnames) }
336    .debug_srcinfo 0 : { *(.debug_srcinfo) }
337    .debug_pubnames 0 : { *(.debug_pubnames) }
338    .debug_aranges 0 : { *(.debug_aranges) }
339    .debug_aregion 0 : { *(.debug_aregion) }
340    .debug_macinfo 0 : { *(.debug_macinfo) }
341    .stab 0 : { *(.stab) }
342    .stabstr 0 : { *(.stabstr) }
343}
Note: See TracBrowser for help on using the repository browser.