source: rtems/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds @ 612297e8

Last change on this file since 612297e8 was 612297e8, checked in by Joel Sherrill <joel@…>, on Jul 12, 2016 at 10:44:17 AM

Misc: Spell length correctly

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