source: rtems/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.hsc_cm01 @ e35c696

4.104.114.84.95
Last change on this file since e35c696 was e35c696, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 08/10/07 at 08:15:58

added BSP hsc_cm01

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