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

4.104.114.84.9
Last change on this file since 7da3405 was 7da3405, checked in by Joel Sherrill <joel.sherrill@…>, on Jun 20, 2007 at 9:42:00 PM

2007-06-20 Joel Sherrill <joel.sherrill@…>

Add Embedded Planets EP5200 which is the same as the Freescale
5200Lite (a.k.a. IceCube?) evaluation board.

  • Makefile.am: Add linkcmds.ep5200. Add -DMPC5200_BAPI_LIBC_HEADERS to remove some warnings in bestcomm.
  • preinstall.am: Add linkcmds.ep5200.
  • clock/clock.c: Correct math for prescaler/counter when bus speed is high enough to require multiple passes of loop.
  • console/console.c: Use same math for initial baud rate as when it is changed via ioctl. When HAS_UBOOT is defined, initialize console to the same baud as it was with U-Boot.
  • include/bsp.h: Add EP5200 and console boot baud support.
  • include/mpc5200.h: Spacing.
  • startup/bspstart.c: If HAS_UBOOT and SHOW_MORE_INIT_SETTINGS are both defined, dump the U-Boot BD info structure.
  • vectors/vectors.S: ep5200 cannot use vectors segment. When loading it, U-Boot freezes. Besides, U-Boot can automatically start the BSP so we do not have to run from board reset.
  • startup/linkcmds.ep5200: New file.
  • Property mode set to 100644
File size: 8.4 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       
152    PROVIDE (__EXCEPT_START__ = .);
153    .gcc_except_table   : { *(.gcc_except_table) } >ram
154    PROVIDE (__EXCEPT_END__ = .);
155    __GOT_START__ = .;
156    .got :
157    {
158      s.got = .;
159      *(.got.plt) *(.got)
160    } > ram
161    __GOT_END__ = .;
162       
163    .got1                 : { *(.got1)          } >ram
164    PROVIDE (__GOT2_START__ = .);
165    PROVIDE (_GOT2_START_ = .);
166    .got2                 :  { *(.got2)         } >ram
167    PROVIDE (__GOT2_END__ = .);
168    PROVIDE (_GOT2_END_ = .);
169   
170    PROVIDE (__FIXUP_START__ = .);
171    PROVIDE (_FIXUP_START_ = .);
172    .fixup        : { *(.fixup)         } >ram
173    PROVIDE (_FIXUP_END_ = .);
174    PROVIDE (__FIXUP_END__ = .);
175 
176    .rel.dyn : {
177      *(.rel.init)
178      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
179      *(.rel.fini)
180      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
181      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
182      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
183      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
184      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
185      *(.rel.ctors)
186      *(.rel.dtors)
187      *(.rel.got)
188      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
189      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
190      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
191      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
192      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
193    } >ram
194    .rela.dyn : {
195      *(.rela.init)
196      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
197      *(.rela.fini)
198      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
199      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
200      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
201      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
202      *(.rela.ctors)
203      *(.rela.dtors)
204      *(.rela.got)
205      *(.rela.got1)
206      *(.rela.got2)
207      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
208      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
209      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
210      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
211      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
212    } >ram
213
214    PROVIDE (__SDATA2_START__ = .);
215    .sdata2       : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >ram
216    .sbss2        : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >ram
217    PROVIDE (__SBSS2_END__ = .);
218       
219    .sbss2        : { *(.sbss2)         } >ram
220    PROVIDE (__SBSS2_END__ = .);
221       
222    __SBSS_START__ = .;
223    .bss :
224    {
225      bss.start = .;
226      *(.bss .bss* .gnu.linkonce.b*)
227      *(.sbss*) *(COMMON)
228      . = ALIGN(4);
229      bss.end = .;
230    } > ram
231    __SBSS_END__ = .;
232
233
234
235
236
237    /* R/W Data */
238    .data ( . ) :
239    {
240      . = ALIGN (4);
241
242      data.start = .;
243
244      *(.data)
245      *(.data.rel.*)
246      *(.data1)
247      *(.data.* .gnu.linkonce.d.*)
248      PROVIDE (__SDATA_START__ = .);
249      *(.sdata*)
250      *(.gnu.linkonce.s.*)
251      data.end = .;
252    } > ram
253
254    data.size = data.end - data.start;
255    bss.size = bss.end - bss.start;
256    text.size = text.end - text.start;
257
258    PROVIDE(_bss_start   = ADDR(.bss));
259    PROVIDE(_bss_size    = SIZEOF(.bss));
260    PROVIDE(_data_start  = ADDR(.data));
261    PROVIDE(_data_size   = SIZEOF(.data));
262    PROVIDE(_text_start  = ADDR(.text));
263    PROVIDE(_text_size   = SIZEOF(.text));
264    PROVIDE(_end = data.end);
265
266    .gzipmalloc : {
267        . = ALIGN (16);
268        _startmalloc = .;
269     } >ram
270               
271
272    /*
273     * Interrupt stack setup
274     */
275    IntrStack_start = ALIGN(0x10);
276    . += 0x4000;
277    intrStack = .;
278    PROVIDE(intrStackPtr = intrStack);
279
280
281
282    _WorkspaceBase = .;
283    __WorkspaceBase = .;
284    . += WorkSpaceSize;
285
286    _RamDiskBase = .;
287    __RamDiskBase = .;
288    . += RamDiskSize;
289    _RamDiskEnd  = .;
290    __RamDiskEnd = .;
291    PROVIDE( _RamDiskSize = _RamDiskEnd - _RamDiskBase );
292
293    _HeapStart = .;
294    __HeapStart = .;
295    . += HeapSize;
296    _HeapEnd = .;
297    __HeapEnd = .;
298
299    clear_end = .;
300
301    /* Sections for compressed .text and .data         */
302    /* after the .datarom section is an int specifying */
303    /* the length of the following compressed image    */
304    /* Executes once then could get overwritten        */
305    .textrom 0x100000 :
306    {
307        *(.textrom)
308        _endloader = .;
309    } > ram
310
311    .datarom :
312    {
313        _dr_start = .;
314        *(.datarom)
315        _dr_end = .;
316    } > ram
317    dr_len = _dr_end - _dr_start;
318
319    mpc5200_regs :
320    {
321    MBAR = .;
322    mpc5200 = .;
323    _mpc5200 = .;
324    . += (0x6000);
325    } > mpc5200_regs
326
327
328     /* the reset vector is at 0xfff00000 which is */
329     /* located at offset 0x400000 from the base   */
330     /* of flash                                   */
331    .bootrom 0xFFE00000 :
332    {
333      *(.bootrom)
334      _endboot = .;
335    } > flash
336
337
338    .line 0 : { *(.line) }
339    .debug 0 : { *(.debug) }
340    .debug_sfnames 0 : { *(.debug_sfnames) }
341    .debug_srcinfo 0 : { *(.debug_srcinfo) }
342    .debug_pubnames 0 : { *(.debug_pubnames) }
343    .debug_aranges 0 : { *(.debug_aranges) }
344    .debug_aregion 0 : { *(.debug_aregion) }
345    .debug_macinfo 0 : { *(.debug_macinfo) }
346    .stab 0 : { *(.stab) }
347    .stabstr 0 : { *(.stabstr) }
348}
Note: See TracBrowser for help on using the repository browser.