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

4.104.114.84.95
Last change on this file since 350808f was 9c1133e, checked in by Joel Sherrill <joel.sherrill@…>, on 01/20/03 at 19:57:14

mkChangeLogList [-n]

  • 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    *(.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  /* R/W Data */
145  .data :
146  {
147    data_start = .;
148   
149    *(.data)
150    *(.data.*)
151    *(.data1)
152   
153    PROVIDE (__SDATA_START__ = .);
154    *(.sdata)
155    *(.gnu.linkonce.d*)
156    *(.gnu.linkonce.s.*)
157    PROVIDE (__SDATA_END__ = .);
158   
159    PROVIDE (__EXCEPT_START__ = .);
160    *(.gcc_except_table)
161    PROVIDE (__EXCEPT_END__ = .);
162   
163    PROVIDE(__GOT_START__ = .);
164    *(.got.plt)
165    *(.got)
166    PROVIDE(__GOT_END__ = .);
167       
168    *(.got1)
169   
170    PROVIDE (__GOT2_START__ = .);
171    PROVIDE (_GOT2_START_ = .);
172    *(.got2)
173    PROVIDE (__GOT2_END__ = .);
174    PROVIDE (_GOT2_END_ = .);
175       
176    PROVIDE (__FIXUP_START__ = .);
177    PROVIDE (_FIXUP_START_ = .);
178    *(.fixup)
179    PROVIDE (_FIXUP_END_ = .);
180    PROVIDE (__FIXUP_END__ = .);
181
182  /*  We want the small data sections together, so single-instruction offsets
183   *   can access them all.
184   */
185    PROVIDE (__SDATA2_START__ = .);
186    *(.sdata2)
187    *(.gnu.linkonce.s2.*)
188    *(.sbss2)
189    PROVIDE (__SDATA2_END__ = .);
190  } > ram
191       
192         
193  .bss :
194  {
195    PROVIDE (__SBSS_START__ = .);
196       
197    PROVIDE (__SBSS2_START__ = .);
198    *(.sbss2)
199    PROVIDE (__SBSS2_END__ = .);
200       
201    bss.start = .;
202    *(.bss)
203    *(.sbss)
204    *(COMMON)
205    . = ALIGN(4);
206    bss.end = .;
207   
208   PROVIDE (__SBSS_END__ = .);
209
210  } > ram
211 
212  bss.size = bss.end - bss.start;
213  text.size = text.end - text.start;
214  PROVIDE(_end = bss.end);
215  /*
216   * Interrupt stack setup
217   */
218
219  IntrStack_start = ALIGN(0x10);
220  . += 0x4000;
221  intrStack = .;
222  PROVIDE(intrStackPtr = intrStack);
223
224  _HeapStart = .;
225  __HeapStart = .;
226  . += HeapSize;  /* XXX -- Old gld can't handle this */
227  /* . += 0x80000; */ /* HeapSize for old gld */
228  _HeapEnd = .;
229  __HeapEnd = .;
230  clear_end = .;
231       
232  _WorkspaceBase = .;
233  __WorkspaceBase = .;
234       
235  dpram :
236  {
237  m8xx = .;
238  _m8xx = .;
239  . += (16 * 1024);
240  } >immr
241
242  /* Stabs debugging sections.  */
243  .stab 0 : { *(.stab) }
244  .stabstr 0 : { *(.stabstr) }
245  .stab.excl 0 : { *(.stab.excl) }
246  .stab.exclstr 0 : { *(.stab.exclstr) }
247  .stab.index 0 : { *(.stab.index) }
248  .stab.indexstr 0 : { *(.stab.indexstr) }
249  .comment 0 : { *(.comment) }
250 
251  /* DWARF debug sections.
252     Symbols in the DWARF debugging sections are relative to the beginning
253     of the section so we begin them at 0.  */
254  /* DWARF 1 */
255  .debug          0 : { *(.debug) }
256  .line           0 : { *(.line) }
257 
258  /* GNU DWARF 1 extensions */
259  .debug_srcinfo  0 : { *(.debug_srcinfo) }
260  .debug_sfnames  0 : { *(.debug_sfnames) }
261 
262  /* DWARF 1.1 and DWARF 2 */
263  .debug_aranges  0 : { *(.debug_aranges) }
264  .debug_pubnames 0 : { *(.debug_pubnames) }
265 
266  /* DWARF 2 */
267  .debug_info     0 : { *(.debug_info) }
268  .debug_abbrev   0 : { *(.debug_abbrev) }
269  .debug_line     0 : { *(.debug_line) }
270  .debug_frame    0 : { *(.debug_frame) }
271  .debug_str      0 : { *(.debug_str) }
272  .debug_loc      0 : { *(.debug_loc) }
273  .debug_macinfo  0 : { *(.debug_macinfo) }
274 
275  /* SGI/MIPS DWARF 2 extensions */
276  .debug_weaknames 0 : { *(.debug_weaknames) }
277  .debug_funcnames 0 : { *(.debug_funcnames) }
278  .debug_typenames 0 : { *(.debug_typenames) }
279  .debug_varnames  0 : { *(.debug_varnames) }
280  /* These must appear regardless of  .  */
281}
Note: See TracBrowser for help on using the repository browser.