source: rtems/c/src/lib/libbsp/powerpc/gen5200/startup/linkcmds @ 9a7474b

4.104.114.84.95
Last change on this file since 9a7474b was 9a7474b, checked in by Joel Sherrill <joel.sherrill@…>, on 02/08/06 at 12:26:31

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

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