source: rtems/bsps/powerpc/haleakala/start/linkcmds @ 84e59b7c

5
Last change on this file since 84e59b7c was 84e59b7c, checked in by Sebastian Huber <sebastian.huber@…>, on 11/15/18 at 19:47:22

bsps/powerpc: Use interrupt stack for init stack

Move start.o to separate file.

Update #3459.

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