source: rtems/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.icecube @ bdced05e

4.104.114.95
Last change on this file since bdced05e was 48593d7, checked in by Joel Sherrill <joel.sherrill@…>, on 07/11/07 at 14:43:21

2007-07-11 Joel Sherrill <joel.sherrill@…>

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