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

4.104.114.84.95
Last change on this file since dfef80e8 was dfef80e8, checked in by Joel Sherrill <joel.sherrill@…>, on 07/13/07 at 15:41:22

2007-07-13 Joel Sherrill <joel.sherrill@…>

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