source: rtems/c/src/lib/libbsp/powerpc/mbx8xx/startup/linkcmds @ 284ed06a

4.104.115
Last change on this file since 284ed06a was 284ed06a, checked in by Joel Sherrill <joel.sherrill@…>, on 09/16/08 at 21:35:23

2008-09-16 Joel Sherrill <joel.sherrill@…>

  • Makefile.am, startup/linkcmds: Use top level shared bsp_get_work_area() implementation.
  • startup/bspgetworkarea.c: Removed.
  • Property mode set to 100644
File size: 8.0 KB
Line 
1/*
2 *  This file contains directives for the GNU linker that are specific
3 *  to the MBX860-2 board.
4 *
5 *  $Id$
6 */
7
8OUTPUT_FORMAT("elf32-powerpc", "elf32-powerpc", "elf32-powerpc")
9OUTPUT_ARCH(powerpc)
10ENTRY(start)
11
12/*
13 * Declare some sizes.
14 * XXX: The assignment of ". += XyzSize;" fails in older gld's if the
15 *      number used there is not constant.  If this happens to you, edit
16 *      the lines marked XXX below to use a constant value.
17 */
18StackSize = DEFINED(StackSize) ? StackSize : 0x1000;
19RamBase = DEFINED(RamBase) ? RamBase : 0;
20RamSize = DEFINED(RamSize) ? RamSize : 4M;
21HeapSize = DEFINED(HeapSize) ? HeapSize : 0x0;
22 
23MEMORY
24        {
25        ram : org = 0x0, l = 4M
26        nvram : org = 0xfa000000, l = 32K
27        dpram : org = 0xfa200000, l = 16K
28        flash : org = 0xfc000000, l = 2M
29        immr  : org = 0xfa200000, l = 16K
30        }
31
32
33SECTIONS
34{
35  /*
36   *  If the vectors are specified statically rather than created at run time,
37   *  accumulate them starting at VMA 0x0.
38   */
39  .vectors :
40  {
41    *(.vectors)
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    /* Read-only sections, merged into text segment: */
52   
53    text.start = .;
54
55    /* Entry point is the .entry section */
56    *(.entry)
57    *(.entry2)
58
59    /* Actual code */
60    *(.text*)
61             
62    /* C++ constructors/destructors */
63    *(.gnu.linkonce.t*)
64             
65    /*  Initialization and finalization code.
66     *
67     *  Various files can provide initialization and finalization functions.
68     *  The bodies of these functions are in .init and .fini sections. We
69     *  accumulate the bodies here, and prepend function prologues from
70     *  ecrti.o and function epilogues from ecrtn.o. ecrti.o must be linked
71     *  first; ecrtn.o must be linked last. Because these are wildcards, it
72     *  doesn't matter if the user does not actually link against ecrti.o and
73     *  ecrtn.o; the linker won't look for a file to match a wildcard.  The
74     *  wildcard also means that it doesn't matter which directory ecrti.o
75     *  and ecrtn.o are in.
76     */
77    PROVIDE (_init = .);
78    *ecrti.o(.init)
79    *(.init)
80    *ecrtn.o(.init)
81   
82    PROVIDE (_fini = .);
83    *ecrti.o(.fini)
84    *(.fini)
85    *ecrtn.o(.init)
86
87    /*
88     *  C++ constructors and destructors for static objects.
89     *  PowerPC EABI does not use crtstuff yet, so we build "old-style"
90     *  constructor and destructor lists that begin with the list lenght
91     *  end terminate with a NULL entry.
92     */
93     
94    PROVIDE (__CTOR_LIST__ = .);             
95    /* LONG((__CTOR_END__ - __CTOR_LIST__) / 4 - 2) */
96    *crtbegin.o(.ctors)
97    *(.ctors)
98    *crtend.o(.ctors)
99    LONG(0)
100    PROVIDE (__CTOR_END__ = .);
101       
102    PROVIDE (__DTOR_LIST__ = .);
103    /* LONG((__DTOR_END__ - __DTOR_LIST__) / 4 - 2) */
104    *crtbegin.o(.dtors)
105    *(.dtors)
106    *crtend.o(.dtors)
107    LONG(0)
108    PROVIDE (__DTOR_END__ = .);
109       
110    /*
111     * Special FreeBSD sysctl sections.
112     */
113    . = ALIGN (16);
114    __start_set_sysctl_set = .;
115    *(set_sysctl_*);
116    __stop_set_sysctl_set = ABSOLUTE(.);
117    *(set_domain_*);
118    *(set_pseudo_*);
119
120    /* Exception frame info */
121    *(.eh_frame)
122
123   /* Miscellaneous read-only data */
124    _rodata_start = . ;
125    *(.gnu.linkonce.r*)
126    *(.lit)
127    *(.shdata)
128    *(.rodata*)
129    *(.rodata1)
130    *.(eh_frame)
131    *(.descriptors)
132    *(rom_ver)
133    _erodata = .;
134
135
136    /* Various possible names for the end of the .text section */
137    etext = ALIGN(0x10);
138    _etext = .;
139    _endtext = .;
140    text.end = .;
141    PROVIDE (etext = .);
142    PROVIDE (__etext = .);
143 } > ram
144 
145  .rel.dyn        :
146    {
147      *(.rel.init)
148      *(.rel.text .rel.text.* .rel.gnu.linkonce.t.*)
149      *(.rel.fini)
150      *(.rel.rodata .rel.rodata.* .rel.gnu.linkonce.r.*)
151      *(.rel.data.rel.ro* .rel.gnu.linkonce.d.rel.ro.*)
152      *(.rel.data .rel.data.* .rel.gnu.linkonce.d.*)
153      *(.rel.tdata .rel.tdata.* .rel.gnu.linkonce.td.*)
154      *(.rel.tbss .rel.tbss.* .rel.gnu.linkonce.tb.*)
155      *(.rel.ctors)
156      *(.rel.dtors)
157      *(.rel.got)
158      *(.rel.sdata .rel.sdata.* .rel.gnu.linkonce.s.*)
159      *(.rel.sbss .rel.sbss.* .rel.gnu.linkonce.sb.*)
160      *(.rel.sdata2 .rel.sdata2.* .rel.gnu.linkonce.s2.*)
161      *(.rel.sbss2 .rel.sbss2.* .rel.gnu.linkonce.sb2.*)
162      *(.rel.bss .rel.bss.* .rel.gnu.linkonce.b.*)
163    } >ram
164  .rela.dyn       :
165    {
166      *(.rela.init)
167      *(.rela.text .rela.text.* .rela.gnu.linkonce.t.*)
168      *(.rela.fini)
169      *(.rela.rodata .rela.rodata.* .rela.gnu.linkonce.r.*)
170      *(.rela.data .rela.data.* .rela.gnu.linkonce.d.*)
171      *(.rela.tdata .rela.tdata.* .rela.gnu.linkonce.td.*)
172      *(.rela.tbss .rela.tbss.* .rela.gnu.linkonce.tb.*)
173      *(.rela.ctors)
174      *(.rela.dtors)
175      *(.rela.got)
176      *(.rela.got1)
177      *(.rela.got2)
178      *(.rela.sdata .rela.sdata.* .rela.gnu.linkonce.s.*)
179      *(.rela.sbss .rela.sbss.* .rela.gnu.linkonce.sb.*)
180      *(.rela.sdata2 .rela.sdata2.* .rela.gnu.linkonce.s2.*)
181      *(.rela.sbss2 .rela.sbss2.* .rela.gnu.linkonce.sb2.*)
182      *(.rela.bss .rela.bss.* .rela.gnu.linkonce.b.*)
183    } >ram
184  .rel.plt        : { *(.rel.plt) }
185  .rela.plt       : { *(.rela.plt) }
186
187  /* R/W Data */
188  .data :
189  {
190    data_start = .;
191   
192    *(.data)
193    *(.data.*)
194    *(.data1)
195   
196    PROVIDE (__SDATA_START__ = .);
197    *(.sdata*)
198    *(.gnu.linkonce.d*)
199    *(.gnu.linkonce.s.*)
200    PROVIDE (__SDATA_END__ = .);
201   
202    PROVIDE (__EXCEPT_START__ = .);
203    *(.gcc_except_table*)
204    PROVIDE (__EXCEPT_END__ = .);
205   
206    PROVIDE(__GOT_START__ = .);
207    *(.got.plt)
208    *(.got)
209    PROVIDE(__GOT_END__ = .);
210       
211    *(.got1)
212   
213    PROVIDE (__GOT2_START__ = .);
214    PROVIDE (_GOT2_START_ = .);
215    *(.got2)
216    PROVIDE (__GOT2_END__ = .);
217    PROVIDE (_GOT2_END_ = .);
218       
219    PROVIDE (__FIXUP_START__ = .);
220    PROVIDE (_FIXUP_START_ = .);
221    *(.fixup)
222    PROVIDE (_FIXUP_END_ = .);
223    PROVIDE (__FIXUP_END__ = .);
224
225  /*  We want the small data sections together, so single-instruction offsets
226   *   can access them all.
227   */
228    PROVIDE (__SDATA2_START__ = .);
229    *(.sdata2)
230    *(.gnu.linkonce.s2.*)
231    *(.sbss2)
232    PROVIDE (__SDATA2_END__ = .);
233  } > ram
234       
235         
236  .bss :
237  {
238    PROVIDE (__SBSS_START__ = .);
239       
240    PROVIDE (__SBSS2_START__ = .);
241    *(.sbss2)
242    PROVIDE (__SBSS2_END__ = .);
243       
244    bss.start = .;
245    *(.bss .bss* .gnu.linkonce.b*)
246    *(.sbss*)
247    *(COMMON)
248    . = ALIGN(4);
249    bss.end = .;
250   
251   PROVIDE (__SBSS_END__ = .);
252
253  } > ram
254 
255  bss.size = bss.end - bss.start;
256  text.size = text.end - text.start;
257  PROVIDE(_end = bss.end);
258  /*
259   * Interrupt stack setup
260   */
261
262  IntrStack_start = ALIGN(0x10);
263  . += 0x4000;
264  intrStack = .;
265  PROVIDE(intrStackPtr = intrStack);
266
267  WorkAreaBase = .;
268
269  dpram :
270  {
271  m8xx = .;
272  _m8xx = .;
273  /*   . += (16 * 1024); this makes the mbx loader crash */
274  } >immr
275
276  /* Stabs debugging sections.  */
277  .stab 0 : { *(.stab) }
278  .stabstr 0 : { *(.stabstr) }
279  .stab.excl 0 : { *(.stab.excl) }
280  .stab.exclstr 0 : { *(.stab.exclstr) }
281  .stab.index 0 : { *(.stab.index) }
282  .stab.indexstr 0 : { *(.stab.indexstr) }
283  .comment 0 : { *(.comment) }
284 
285  /* DWARF debug sections.
286     Symbols in the DWARF debugging sections are relative to the beginning
287     of the section so we begin them at 0.  */
288  /* DWARF 1 */
289  .debug          0 : { *(.debug) }
290  .line           0 : { *(.line) }
291 
292  /* GNU DWARF 1 extensions */
293  .debug_srcinfo  0 : { *(.debug_srcinfo) }
294  .debug_sfnames  0 : { *(.debug_sfnames) }
295 
296  /* DWARF 1.1 and DWARF 2 */
297  .debug_aranges  0 : { *(.debug_aranges) }
298  .debug_pubnames 0 : { *(.debug_pubnames) }
299 
300  /* DWARF 2 */
301  .debug_info     0 : { *(.debug_info) }
302  .debug_abbrev   0 : { *(.debug_abbrev) }
303  .debug_line     0 : { *(.debug_line) }
304  .debug_frame    0 : { *(.debug_frame) }
305  .debug_str      0 : { *(.debug_str) }
306  .debug_loc      0 : { *(.debug_loc) }
307  .debug_macinfo  0 : { *(.debug_macinfo) }
308 
309  /* SGI/MIPS DWARF 2 extensions */
310  .debug_weaknames 0 : { *(.debug_weaknames) }
311  .debug_funcnames 0 : { *(.debug_funcnames) }
312  .debug_typenames 0 : { *(.debug_typenames) }
313  .debug_varnames  0 : { *(.debug_varnames) }
314  /* These must appear regardless of  .  */
315}
Note: See TracBrowser for help on using the repository browser.