source: rtems/c/src/lib/libbsp/powerpc/gen83xx/startup/linkcmds.mpc8349eamds @ 42bf1b9

4.104.114.95
Last change on this file since 42bf1b9 was 42bf1b9, checked in by Thomas Doerfler <Thomas.Doerfler@…>, on 05/15/08 at 15:10:38

adapted gen83xx to new board

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