source: rtems/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds @ 2d2de4eb

4.104.115
Last change on this file since 2d2de4eb was 2d2de4eb, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 10/23/09 at 07:32:46

Update for exception support changes.

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