source: rtems/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds @ 4217b96

4.104.114.84.9
Last change on this file since 4217b96 was 4217b96, checked in by Joel Sherrill <joel.sherrill@…>, on Feb 8, 2006 at 12:28:38 PM

2006-02-08 Joel Sherrill <joel@…>

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