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

4.104.114.84.95
Last change on this file since 4217b96 was 4217b96, checked in by Joel Sherrill <joel.sherrill@…>, on 02/08/06 at 12:28:38

2006-02-08 Joel Sherrill <joel@…>

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