source: rtems/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds.brs5l @ a557bdf6

4.104.114.95
Last change on this file since a557bdf6 was a557bdf6, checked in by Joel Sherrill <joel.sherrill@…>, on 03/03/08 at 23:07:08

2008-03-03 Joel Sherrill <joel.sherrill@…>

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