source: rtems/c/src/lib/libbsp/powerpc/mpc8260ads/startup/linkcmds @ 3d5f97f

4.104.114.84.9
Last change on this file since 3d5f97f was 3d5f97f, checked in by Joel Sherrill <joel.sherrill@…>, on Jan 4, 2005 at 11:29:33 PM

2005-01-04 Joel Sherrill <joel@…>

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