source: rtems/c/src/lib/libbsp/powerpc/haleakala/startup/linkcmds @ 574fb67

4.104.114.95
Last change on this file since 574fb67 was 574fb67, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 07/14/08 at 16:15:28

updated gen83xx BSP
updated haleakala BSP
added MPC55xx BSP

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