source: rtems/bsps/powerpc/haleakala/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: 7.3 KB
Line 
1/*
2 *  This file contains directives for the GNU linker which are specific
3 *  to the 405GP/EX
4 *  This file is intended to be used together with dlentry.s
5 *  it will generate downloadable code
6 *
7 *  Modifications for gen405 by Dennis Ehlin
8 *  Modifications for virtex by Keith, Greg, and Bob
9 *  Modifications for 405GP/EX by Michael Hamel
10 */
11
12OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
13OUTPUT_ARCH(powerpc)
14STARTUP(start.o)
15ENTRY(download_entry)
16EXTERN(__vectors)
17
18RamBase = DEFINED(RamBase) ? RamBase : 0;
19RamSize = DEFINED(RamSize) ? RamSize : 256M;
20HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
21
22MEMORY {
23        RAM : ORIGIN = 0, LENGTH = 256M
24        /*FLASH : ORIGIN = 0xFFE00000, LENGTH = 16M*/
25}
26
27/*
28 * Max sdata/bss.
29 */
30bsp_section_small_data_area_size = 65536;
31
32SECTIONS
33{
34  /* First 16K is occupied by exception vectors and anything else we want to put there */
35  .text 0x4000:
36  {
37     text.start = . ;
38     *(.entry)
39     *(.entry2)
40     *(.text*)
41     *(.rodata*)
42     *(.rodata1)
43     KEEP (*(SORT(.rtemsroset.*)))
44
45     /*
46      * Special FreeBSD sysctl sections.
47      */
48     . = ALIGN (16);
49     __start_set_sysctl_set = .;
50     *(set_sysctl_*);
51     __stop_set_sysctl_set = ABSOLUTE(.);
52     *(set_domain_*);
53     *(set_pseudo_*);
54
55    /* C++ constructors/destructors */
56    *(.gnu.linkonce.t*)
57
58    /*  Initialization and finalization code.
59     *
60     *  Various files can provide initialization and finalization functions.
61     *  The bodies of these functions are in .init and .fini sections. We
62     *  accumulate the bodies here, and prepend function prologues from
63     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
64     *  first; ecrtn.o must be linked last. Because these are wildcards, it
65     *  doesn't matter if the user does not actually link against ecrti.o and
66     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
67     *  wildcard also means that it doesn't matter which directory ecrti.o
68     *  and ecrtn.o are in.
69     */
70    PROVIDE (_init = .);
71    *ecrti.o(.init)
72    *(.init)
73    *ecrtn.o(.init)
74   
75    PROVIDE (_fini = .);
76    *ecrti.o(.fini)
77    *(.fini)
78    *ecrtn.o(.init)
79
80    KEEP (*ecrti.o(.ctors))
81    KEEP (*crtbegin.o(.ctors))
82    KEEP (*crtbegin?.o(.ctors))
83    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .ctors))
84    KEEP (*(SORT(.ctors.*)))
85    KEEP (*(.ctors))
86    KEEP (*ecrti.o(.dtors))
87    KEEP (*crtbegin.o(.dtors))
88    KEEP (*crtbegin?.o(.dtors))
89    KEEP (*(EXCLUDE_FILE (*crtend.o *crtend?.o *ecrtn.o) .dtors))
90    KEEP (*(SORT(.dtors.*)))
91    KEEP (*(.dtors))
92
93    /* Exception frame info */
94     *(.eh_frame)
95    /* Miscellaneous read-only data */
96    _rodata_start = . ;
97    *(.gnu.linkonce.r*)
98    *(.lit)
99    *(.shdata)
100    *(.rodata)
101    *(.rodata1)
102    *(.descriptors)
103    *(rom_ver)
104    _erodata = .;
105
106    PROVIDE (__EXCEPT_START__ = .);
107    *(.gcc_except_table*)
108    PROVIDE (__EXCEPT_END__ = .);
109    __GOT_START__ = .;
110    s.got = .;
111    *(.got.plt)
112    *(.got)
113    *(.got1)
114    PROVIDE (__GOT2_START__ = .);
115    PROVIDE (_GOT2_START_ = .);
116    *(.got2)
117    PROVIDE (__GOT2_END__ = .);
118    PROVIDE (_GOT2_END_ = .);
119   
120    PROVIDE (__FIXUP_START__ = .);
121    PROVIDE (_FIXUP_START_ = .);
122    *(.fixup)
123    PROVIDE (_FIXUP_END_ = .);
124    PROVIDE (__FIXUP_END__ = .);
125   
126
127    /* Various possible names for the end of the .text section */
128     etext = ALIGN(0x10);
129     _etext = .;
130
131     *(.lit)
132     *(.shdata)
133     _endtext = ALIGN(0x10);
134     text.end = .;
135     text.size = text.end - text.start;
136  } >RAM
137
138  text.size = text.end - text.start;
139
140  .tdata : {
141    _TLS_Data_begin = .;
142    *(.tdata .tdata.* .gnu.linkonce.td.*)
143    _TLS_Data_end = .;
144  } >RAM
145
146  .tbss : {
147    _TLS_BSS_begin = .;
148    *(.tbss .tbss.* .gnu.linkonce.tb.*) *(.tcommon)
149    _TLS_BSS_end = .;
150  } >RAM
151
152  _TLS_Data_size = _TLS_Data_end - _TLS_Data_begin;
153  _TLS_Data_begin = _TLS_Data_size != 0 ? _TLS_Data_begin : _TLS_BSS_begin;
154  _TLS_Data_end = _TLS_Data_size != 0 ? _TLS_Data_end : _TLS_BSS_begin;
155  _TLS_BSS_size = _TLS_BSS_end - _TLS_BSS_begin;
156  _TLS_Size = _TLS_BSS_end - _TLS_Data_begin;
157  _TLS_Alignment = MAX (ALIGNOF (.tdata), ALIGNOF (.tbss));
158
159  .jcr : { KEEP (*(.jcr)) } >RAM
160
161    .rel.dyn : {
162      *(.rel.init)
163      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
164      *(.rel.fini)
165      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
166      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
167      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
168      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
169      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
170      *(.rel.ctors)
171      *(.rel.dtors)
172      *(.rel.got)
173      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
174      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
175      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
176      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
177      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
178    } >RAM
179    .rela.dyn : {
180      *(.rela.init)
181      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
182      *(.rela.fini)
183      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
184      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
185      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
186      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
187      *(.rela.ctors)
188      *(.rela.dtors)
189      *(.rela.got)
190      *(.rela.got1)
191      *(.rela.got2)
192      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
193      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
194      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
195      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
196      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
197    } >RAM
198
199
200    /* Initialised large data */
201    .data ( . ) :
202    {
203      . = ALIGN (4);
204      data.start = .;
205      *(.data)
206      *(.data1)
207      KEEP (*(SORT(.rtemsrwset.*)))
208      *(.data.* .gnu.linkonce.d.*)
209      data.end = .;
210    } > RAM
211
212        /* Initialised small data addressed as offsets from r13 */
213        .sdata : {
214      . = ALIGN (4);
215          PROVIDE (__SDATA_START__ = .);
216      bsp_section_sdata_begin = .;
217      sdata.start = .;
218          *(.sdata*)
219      *(.gnu.linkonce.s.*)
220          sdata.end = .;
221      bsp_section_sdata_end = .;
222        } > RAM
223
224        /* Zeroed small data addressed as offsets from r13 */
225   .sbss : {
226      . = ALIGN (4);
227          PROVIDE(__SBSS_START__ = .);
228      bsp_section_sbss_begin = .;
229          sbss.start = .;
230      *(.sbss .sbss.* *.gnu.linkonce.sb.*);
231          sbss.end = .;
232      bsp_section_sbss_end = .;
233      bsp_section_sdata_libdl_begin = .;
234      . = DEFINED(bsp_section_small_data_area_size) ?
235            bsp_section_sdata_begin + bsp_section_small_data_area_size : .;
236      bsp_section_sdata_libdl_end = .;
237    } > RAM
238    PROVIDE(__SBSS_END__ = .);
239
240        /* Zeroed large data */
241        .bss : {
242      . = ALIGN (4);
243          bss.start = .;
244      *(.bss .bss* .gnu.linkonce.b*)
245      . = ALIGN(4);
246      bss.end = .;
247    } > RAM
248
249    bss.size = bss.end - bss.start;
250    sbss.size = sbss.end - sbss.start;
251
252    .rtemsstack (NOLOAD) : {
253        *(SORT(.rtemsstack.*))
254    } >RAM
255
256    WorkAreaBase = .;
257
258        /* Debugging information */
259    .line 0 : { *(.line) }
260    .debug 0 : { *(.debug) }
261    .debug_sfnames 0 : { *(.debug_sfnames) }
262    .debug_srcinfo 0 : { *(.debug_srcinfo) }
263    .debug_pubnames 0 : { *(.debug_pubnames) }
264    .debug_aranges 0 : { *(.debug_aranges) }
265    .debug_aregion 0 : { *(.debug_aregion) }
266    .debug_macinfo 0 : { *(.debug_macinfo) }
267    .stab 0 : { *(.stab) }
268    .stabstr 0 : { *(.stabstr) }
269}
Note: See TracBrowser for help on using the repository browser.