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

4.104.115
Last change on this file since b4a52b1 was b4a52b1, checked in by Joel Sherrill <joel.sherrill@…>, on 09/14/08 at 23:43:36

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

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