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

4.104.114.84.95
Last change on this file since 73a312d7 was 73a312d7, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on Aug 7, 2006 at 7:01:25 AM

added startup/linkcmds.brs5l

  • Property mode set to 100644
File size: 6.9 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    PROVIDE (__SDATA2_START__ = .);
172  .sdata2         : { *(.sdata2) *(.gnu.linkonce.s2.*)  } >ram
173  .sbss2          : { *(.sbss2) *(.gnu.linkonce.sb2.*)  } >ram
174    PROVIDE (__SBSS2_END__ = .);
175       
176    .sbss2        : { *(.sbss2)         } >ram
177    PROVIDE (__SBSS2_END__ = .);
178       
179    /* R/W Data */
180    .data ( . ) :
181    {
182      . = ALIGN (4);
183
184      data.start = .;
185
186      *(.data)
187      *(.data1)
188      *(.data.* .gnu.linkonce.d.*)
189      PROVIDE (__SDATA_START__ = .);
190      *(.sdata)
191      *(.gnu.linkonce.s.*)
192      data.end = .;
193    } > ram
194
195    __SBSS_START__ = .;
196    .bss :
197    {
198      bss.start = .;
199      *(.bss) *(.sbss) *(COMMON)
200      . = ALIGN(4);
201      bss.end = .;
202    } > ram
203    __SBSS_END__ = .;
204
205    PROVIDE(_bss_start   = ADDR(.bss));
206    PROVIDE(_bss_size    = SIZEOF(.bss));
207    PROVIDE(_data_start  = ADDR(.data));
208    PROVIDE(_data_size   = SIZEOF(.data));
209    PROVIDE(_text_start  = ADDR(.text));
210    PROVIDE(_text_size   = SIZEOF(.text));
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
229
230    _WorkspaceBase = .;
231    __WorkspaceBase = .;
232    . += WorkSpaceSize;
233
234    _RamDiskBase = .;
235    __RamDiskBase = .;
236    . += RamDiskSize;
237    _RamDiskEnd  = .;
238    __RamDiskEnd = .;
239    PROVIDE( _RamDiskSize = _RamDiskEnd - _RamDiskBase );
240
241    _HeapStart = .;
242    __HeapStart = .;
243    . += HeapSize;
244    _HeapEnd = .;
245    __HeapEnd = .;
246
247    clear_end = .;
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    mpc5200_regs :
268    {
269    MBAR = .;
270    mpc5200 = .;
271    _mpc5200 = .;
272    . += (0x6000);
273    } > mpc5200_regs
274
275    .dpram :
276    {
277      dp_ram = .;
278      _dp_ram = .;
279      . += (0x400);
280     } > dpram
281
282
283     /* the reset vector is at 0xfff00000 which is */
284     /* located at offset 0x400000 from the base   */
285     /* of flash                                   */
286    .bootrom 0xFFE00000 :
287    {
288      *(.bootrom)
289      _endboot = .;
290    } > flash
291
292
293    .line 0 : { *(.line) }
294    .debug 0 : { *(.debug) }
295    .debug_sfnames 0 : { *(.debug_sfnames) }
296    .debug_srcinfo 0 : { *(.debug_srcinfo) }
297    .debug_pubnames 0 : { *(.debug_pubnames) }
298    .debug_aranges 0 : { *(.debug_aranges) }
299    .debug_aregion 0 : { *(.debug_aregion) }
300    .debug_macinfo 0 : { *(.debug_macinfo) }
301    .stab 0 : { *(.stab) }
302    .stabstr 0 : { *(.stabstr) }
303}
Note: See TracBrowser for help on using the repository browser.